summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2023-05-04 20:21:28 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2023-05-04 20:21:28 +0000
commite17e59ee2be160fff35b38b08d68766a971b3069 (patch)
tree3c372aedeab11d56bfad60d227084816dcfaee78 /tests
parent9f70100b639616dbd307c6d7977f15494538c116 (diff)
parente460d6756b86260460986eea292d30225e20d137 (diff)
downloadalembic-e17e59ee2be160fff35b38b08d68766a971b3069.tar.gz
Merge "Added quiet option to command line" into main
Diffstat (limited to 'tests')
-rw-r--r--tests/test_command.py6
-rw-r--r--tests/test_script_production.py20
2 files changed, 12 insertions, 14 deletions
diff --git a/tests/test_command.py b/tests/test_command.py
index 5ec3567..0937930 100644
--- a/tests/test_command.py
+++ b/tests/test_command.py
@@ -1221,14 +1221,16 @@ class CommandLineTest(TestBase):
mock.call(
os.path.abspath(os.path.join(path, "__init__.py")), "w"
),
- mock.call().close(),
+ mock.call().__enter__(),
+ mock.call().__exit__(None, None, None),
mock.call(
os.path.abspath(
os.path.join(path, "versions", "__init__.py")
),
"w",
),
- mock.call().close(),
+ mock.call().__enter__(),
+ mock.call().__exit__(None, None, None),
],
)
diff --git a/tests/test_script_production.py b/tests/test_script_production.py
index 151b3b8..d50f7f5 100644
--- a/tests/test_script_production.py
+++ b/tests/test_script_production.py
@@ -1,5 +1,6 @@
import datetime
import os
+from pathlib import Path
import re
from unittest.mock import patch
@@ -1333,28 +1334,23 @@ class NormPathTest(TestBase):
).replace("/", ":NORM:"),
)
- def test_script_location_muliple(self):
+ def test_script_location_multiple(self):
config = _multi_dir_testing_config()
script = ScriptDirectory.from_config(config)
- def normpath(path):
+ def _normpath(path):
return path.replace("/", ":NORM:")
- normpath = mock.Mock(side_effect=normpath)
+ normpath = mock.Mock(side_effect=_normpath)
with mock.patch("os.path.normpath", normpath):
+ sd = Path(_get_staging_directory()).as_posix()
eq_(
script._version_locations,
[
- os.path.abspath(
- os.path.join(_get_staging_directory(), "model1/")
- ).replace("/", ":NORM:"),
- os.path.abspath(
- os.path.join(_get_staging_directory(), "model2/")
- ).replace("/", ":NORM:"),
- os.path.abspath(
- os.path.join(_get_staging_directory(), "model3/")
- ).replace("/", ":NORM:"),
+ _normpath(os.path.abspath(sd + "/model1/")),
+ _normpath(os.path.abspath(sd + "/model2/")),
+ _normpath(os.path.abspath(sd + "/model3/")),
],
)