]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
remove unnecessary test function 639/head
authorCaselIT <cfederico87@gmail.com>
Fri, 27 Dec 2019 09:33:00 +0000 (10:33 +0100)
committerCaselIT <cfederico87@gmail.com>
Fri, 27 Dec 2019 09:33:00 +0000 (10:33 +0100)
alembic/testing/__init__.py
alembic/testing/util.py
alembic/util/compat.py
tests/test_command.py

index 57c97b50e177231fd6d45ca93b2db549bcdcae28..f1884a97ed9ff100a738bacaed48b2dab747b5a5 100644 (file)
@@ -19,4 +19,3 @@ from .assertions import ne_  # noqa
 from .fixture_functions import combinations  # noqa
 from .fixture_functions import fixture  # noqa
 from .fixtures import TestBase  # noqa
-from .util import ospath  # noqa
index 032e875f388bc0fd945a48d80e7fdebdeeab6c7d..87dfcd58f6dbdbd118bd7c4e90f02aa2da210c30 100644 (file)
@@ -4,8 +4,6 @@
 #
 # This module is part of SQLAlchemy and is released under
 # the MIT License: http://www.opensource.org/licenses/mit-license.php
-from os.path import normpath
-from ..util.compat import win
 
 
 def flag_combinations(*combinations):
@@ -80,11 +78,3 @@ def metadata_fixture(ddl="function"):
         return fixture_functions.fixture(scope=ddl)(run_ddl)
 
     return decorate
-
-
-def ospath(linux_path):
-    """Takes a linux path with / and transforms it to the correct os path.
-    This is mainly to support windows \\"""
-    if win:
-        return normpath(linux_path)
-    return linux_path
index 543113f406b98dc9f34eb11f913ae4d174db7b38..78a93fe97f269c008cd52798f5e85b39ba793b77 100644 (file)
@@ -8,7 +8,6 @@ py2k = sys.version_info.major < 3
 py3k = sys.version_info.major >= 3
 py35 = sys.version_info >= (3, 5)
 py36 = sys.version_info >= (3, 6)
-win = "win" in sys.platform
 
 
 ArgSpec = collections.namedtuple(
index b96bb40c35e29b0a952140062fb06aa6c9f6b9f3..b866d63bb0f62665891b782a7469067488d0b6b1 100644 (file)
@@ -16,7 +16,6 @@ from alembic.testing import assert_raises
 from alembic.testing import assert_raises_message
 from alembic.testing import eq_
 from alembic.testing import mock
-from alembic.testing import ospath
 from alembic.testing.env import _get_staging_directory
 from alembic.testing.env import _no_sql_testing_config
 from alembic.testing.env import _sqlite_file_db
@@ -886,7 +885,7 @@ class EditTest(TestBase):
         command.stamp(self.cfg, "base")
 
     def test_edit_head(self):
-        expected_call_arg = ospath(
+        expected_call_arg = os.path.normpath(
             "%s/scripts/versions/%s_revision_c.py"
             % (EditTest.cfg.config_args["here"], EditTest.c,)
         )
@@ -896,7 +895,7 @@ class EditTest(TestBase):
             edit.assert_called_with(expected_call_arg)
 
     def test_edit_b(self):
-        expected_call_arg = ospath(
+        expected_call_arg = os.path.normpath(
             "%s/scripts/versions/%s_revision_b.py"
             % (EditTest.cfg.config_args["here"], EditTest.b,)
         )
@@ -935,7 +934,7 @@ class EditTest(TestBase):
         )
 
     def test_edit_current(self):
-        expected_call_arg = ospath(
+        expected_call_arg = os.path.normpath(
             "%s/scripts/versions/%s_revision_b.py"
             % (EditTest.cfg.config_args["here"], EditTest.b,)
         )
@@ -1103,7 +1102,10 @@ class CommandLineTest(TestBase):
             "alembic.command.ScriptDirectory"
         ):
             command.init(self.cfg, directory="foobar")
-            eq_(makedirs.mock_calls, [mock.call(ospath("foobar/versions"))])
+            eq_(
+                makedirs.mock_calls,
+                [mock.call(os.path.normpath("foobar/versions"))],
+            )
 
     def test_init_file_doesnt_exist(self):
         def access_(path, mode):
@@ -1120,7 +1122,10 @@ class CommandLineTest(TestBase):
             command.init(self.cfg, directory="foobar")
             eq_(
                 makedirs.mock_calls,
-                [mock.call("foobar"), mock.call(ospath("foobar/versions"))],
+                [
+                    mock.call("foobar"),
+                    mock.call(os.path.normpath("foobar/versions")),
+                ],
             )
 
     def test_init_w_package(self):