Show More
@@ -22,7 +22,7 b' import tempfile' | |||||
22 | import configobj |
|
22 | import configobj | |
23 |
|
23 | |||
24 |
|
24 | |||
25 |
class |
|
25 | class ContextINI(object): | |
26 | """ |
|
26 | """ | |
27 | Allows to create a new test.ini file as a copy of existing one with edited |
|
27 | Allows to create a new test.ini file as a copy of existing one with edited | |
28 | data. If existing file is not present, it creates a new one. Example usage:: |
|
28 | data. If existing file is not present, it creates a new one. Example usage:: |
@@ -21,7 +21,7 b' import time' | |||||
21 |
|
21 | |||
22 | import pytest |
|
22 | import pytest | |
23 |
|
23 | |||
24 |
from fixture import |
|
24 | from fixture import ContextINI | |
25 |
|
25 | |||
26 |
|
26 | |||
27 | @pytest.mark.parametrize("arguments, expected_texts", [ |
|
27 | @pytest.mark.parametrize("arguments, expected_texts", [ | |
@@ -66,7 +66,7 b' def test_vcsserver_with_config(vcsserver' | |||||
66 | {'DEFAULT': {'port': vcsserver_port}}, |
|
66 | {'DEFAULT': {'port': vcsserver_port}}, | |
67 | ] |
|
67 | ] | |
68 |
|
68 | |||
69 |
with |
|
69 | with ContextINI('test.ini', ini_def) as new_test_ini_path: | |
70 | output = call_vcs_server_with_arguments( |
|
70 | output = call_vcs_server_with_arguments( | |
71 | ['--config=' + new_test_ini_path]) |
|
71 | ['--config=' + new_test_ini_path]) | |
72 |
|
72 | |||
@@ -85,7 +85,7 b' def test_vcsserver_with_config_cli_overw' | |||||
85 | {'DEFAULT': {'threadpool_size': '111'}}, |
|
85 | {'DEFAULT': {'threadpool_size': '111'}}, | |
86 | {'DEFAULT': {'timeout': '0'}}, |
|
86 | {'DEFAULT': {'timeout': '0'}}, | |
87 | ] |
|
87 | ] | |
88 |
with |
|
88 | with ContextINI('test.ini', ini_def) as new_test_ini_path: | |
89 | output = call_vcs_server_with_arguments([ |
|
89 | output = call_vcs_server_with_arguments([ | |
90 | '--config=' + new_test_ini_path, |
|
90 | '--config=' + new_test_ini_path, | |
91 | '--host=128.0.0.1', |
|
91 | '--host=128.0.0.1', |
General Comments 0
You need to be logged in to leave comments.
Login now