Improve an assertion, remove conftest

This commit is contained in:
Adrien Ferrand
2019-03-27 14:16:09 +01:00
parent 26606a1707
commit 0246ff81d5
3 changed files with 6 additions and 7 deletions
@@ -0,0 +1,5 @@
import pytest
# Custom assertions defined in the following package need to be registered to be properly
# displayed in a pytest report when they are failing.
pytest.register_assert_rewrite('certbot_integration_tests.certbot_tests.assertions')
@@ -12,8 +12,7 @@ def assert_hook_execution(probe_path, probe_content):
with open(probe_path, 'r') as file:
lines = file.readlines()
# Comparing pattern to each line avoids to match "pre" for a line with "pre-override"
assert [line for line in lines if line == '{0}{1}'.format(probe_content, os.linesep)]
assert '{0}{1}'.format(probe_content, os.linesep) in lines
def assert_save_renew_hook(config_dir, lineage):
@@ -1,5 +0,0 @@
import pytest
# Custom assertions defined in the following package need to be registered to be properly
# displayed in a pytest report when they are failing.
pytest.register_assert_rewrite('certbot_integration_tests.certbot_tests.assertions')