]> arthur.barton.de Git - bup.git/commitdiff
Ensure pytests preserve the cd $(pwd -P) behavior
authorRob Browning <rlb@defaultvalue.org>
Sun, 15 Nov 2020 18:21:28 +0000 (12:21 -0600)
committerRob Browning <rlb@defaultvalue.org>
Thu, 26 Nov 2020 21:53:09 +0000 (15:53 -0600)
Previously handled in the Makefile.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
conftest.py

index 75a39c3866dc4946f4be930b6b1f381993f82916..2f28334319e85df946cd243bc286492e60c47d8f 100644 (file)
@@ -1,4 +1,5 @@
 
+from __future__ import absolute_import
 from os.path import dirname, realpath
 from time import tzset
 import os
@@ -13,6 +14,11 @@ from bup.compat import environ, fsencode
 
 _bup_src_top = realpath(dirname(fsencode(__file__)))
 
+# The "pwd -P" here may not be appropriate in the long run, but we
+# need it until we settle the relevant drecurse/exclusion questions:
+# https://groups.google.com/forum/#!topic/bup-list/9ke-Mbp10Q0
+os.chdir(realpath(os.getcwd()))
+
 @pytest.fixture(autouse=True)
 def ephemeral_env_changes():
     orig_env = environ.copy()