diff options
Diffstat (limited to 'lib/sqlalchemy/testing/plugin/pytestplugin.py')
| -rw-r--r-- | lib/sqlalchemy/testing/plugin/pytestplugin.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index 0bd79eea0..d7da73828 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -9,7 +9,7 @@ import pytest import argparse import inspect import collections -import itertools +import os try: import xdist # noqa @@ -43,6 +43,14 @@ def pytest_configure(config): config.slaveinput["follower_ident"] ) + if config.option.write_idents: + with open(config.option.write_idents, "a") as file_: + file_.write(config.slaveinput["follower_ident"] + "\n") + else: + if config.option.write_idents and \ + os.path.exists(config.option.write_idents): + os.remove(config.option.write_idents) + plugin_base.pre_begin(config.option) plugin_base.set_coverage_flag(bool(getattr(config.option, @@ -58,6 +66,7 @@ def pytest_sessionstart(session): def pytest_sessionfinish(session): plugin_base.final_process_cleanup() + if has_xdist: import uuid |
