Commits

Ronny Pfannschmidt committed abe467c

move fixture

  • Participants
  • Parent commits 00f0d3a

Comments (0)

Files changed (2)

testing/conftest.py

 import pytest
 
+from micromigrate.backend_script import ScriptBackend
+#from micromigrate.backend_a
+
+
+@pytest.fixture
+def dbname(request, tmpdir):
+    db = tmpdir.join('test.sqlite.db')
+
+    @request.addfinalizer
+    def cleanup():
+        import subprocess
+        if db.check():
+            subprocess.call([
+                'sqlite3', str(db), '.dump',
+            ])
+    return db
+
+
+@pytest.fixture
+def db(dbname):
+    return ScriptBackend(dbname)
+
 
 @pytest.mark.tryfirst
 def pytest_runtest_makereport(item, __multicall__):

testing/test_miromigrate.py

 import pytest
 from micromigrate import parse_migration, apply_migrations
-from micromigrate.backend_script import ScriptBackend
 from micromigrate import MigrationError
 
 
-@pytest.fixture
-def dbname(request, tmpdir):
-    db = tmpdir.join('test.sqlite.db')
-
-    @request.addfinalizer
-    def cleanup():
-        import subprocess
-        if db.check():
-            subprocess.call([
-                'sqlite3', str(db), '.dump',
-            ])
-    return db
-
-
-@pytest.fixture
-def db(dbname):
-    return ScriptBackend(dbname)
-
 
 def test_parse_migration():
     result = parse_migration("-- migration test")