From 2c994b441782c9781c0edced351c99cbc9954d0f Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 15 Feb 2019 13:24:17 -0500 Subject: [PATCH 1/5] Document the usage correctly --- integration/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/conftest.py b/integration/conftest.py index 02a6ecba3..db63e66cc 100644 --- a/integration/conftest.py +++ b/integration/conftest.py @@ -52,7 +52,7 @@ def reactor(): @pytest.fixture(scope='session') def temp_dir(request): """ - Invoke like 'py.test --keep ...' to avoid deleting the temp-dir + Invoke like 'py.test --keep-tempdir ...' to avoid deleting the temp-dir """ tmp = mkdtemp(prefix="tahoe") if request.config.getoption('keep', True): From 845e1e7a4a1f2ca5db7f63cc1c880b737cf81e63 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 15 Feb 2019 13:24:23 -0500 Subject: [PATCH 2/5] There is no need for a default. There is always a value. --- integration/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/conftest.py b/integration/conftest.py index db63e66cc..48f220abe 100644 --- a/integration/conftest.py +++ b/integration/conftest.py @@ -55,7 +55,7 @@ def temp_dir(request): Invoke like 'py.test --keep-tempdir ...' to avoid deleting the temp-dir """ tmp = mkdtemp(prefix="tahoe") - if request.config.getoption('keep', True): + if request.config.getoption('keep'): print("Will retain tempdir '{}'".format(tmp)) # I'm leaving this in and always calling it so that the tempdir From 7226fedd9c25fdf3ffb652869f63460a0217f7fb Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 15 Feb 2019 13:37:27 -0500 Subject: [PATCH 3/5] Avoid having this line crammed onto the end of a line of pytest output --- integration/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/conftest.py b/integration/conftest.py index 48f220abe..ff5cb7387 100644 --- a/integration/conftest.py +++ b/integration/conftest.py @@ -56,7 +56,7 @@ def temp_dir(request): """ tmp = mkdtemp(prefix="tahoe") if request.config.getoption('keep'): - print("Will retain tempdir '{}'".format(tmp)) + print("\nWill retain tempdir '{}'".format(tmp)) # I'm leaving this in and always calling it so that the tempdir # path is (also) printed out near the end of the run From 9a77f1d2e9e3d3fe5d2bcf43410da0f30c3b42a5 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 15 Feb 2019 13:37:42 -0500 Subject: [PATCH 4/5] This default is also not necessary. --- integration/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/conftest.py b/integration/conftest.py index ff5cb7387..fd9e4d8b9 100644 --- a/integration/conftest.py +++ b/integration/conftest.py @@ -61,7 +61,7 @@ def temp_dir(request): # I'm leaving this in and always calling it so that the tempdir # path is (also) printed out near the end of the run def cleanup(): - if request.config.getoption('keep', True): + if request.config.getoption('keep'): print("Keeping tempdir '{}'".format(tmp)) else: try: From 9b2bc66c6cce1853a2c20d11e6e6b8e24552c761 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 15 Feb 2019 13:39:25 -0500 Subject: [PATCH 5/5] news fragment --- newsfragments/2970.other | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/2970.other diff --git a/newsfragments/2970.other b/newsfragments/2970.other new file mode 100644 index 000000000..881a1dd3b --- /dev/null +++ b/newsfragments/2970.other @@ -0,0 +1 @@ +The integration tests now correctly document the `--keep-tempdir` option. \ No newline at end of file