import builtins
import os
import sys
+import re
import encodings
import subprocess
# Need to make sure to not import 'site' if someone specified ``-S`` at the
with captured_output("stderr") as err_out:
site.addpackage(pth_dir, pth_fn, set())
self.assertRegexpMatches(err_out.getvalue(), "line 1")
- self.assertRegexpMatches(err_out.getvalue(), os.path.join(pth_dir, pth_fn))
+ self.assertRegexpMatches(err_out.getvalue(),
+ re.escape(os.path.join(pth_dir, pth_fn)))
# XXX: the previous two should be independent checks so that the
# order doesn't matter. The next three could be a single check
# but my regex foo isn't good enough to write it.
with captured_output("stderr") as err_out:
site.addpackage(pth_dir, pth_fn, set())
self.assertRegexpMatches(err_out.getvalue(), "line 2")
- self.assertRegexpMatches(err_out.getvalue(), os.path.join(pth_dir, pth_fn))
+ self.assertRegexpMatches(err_out.getvalue(),
+ re.escape(os.path.join(pth_dir, pth_fn)))
# XXX: ditto previous XXX comment.
self.assertRegexpMatches(err_out.getvalue(), 'Traceback')
self.assertRegexpMatches(err_out.getvalue(), 'ImportError')
with captured_output("stderr") as err_out:
site.addpackage(pth_dir, pth_fn, set())
self.assertRegexpMatches(err_out.getvalue(), "line 1")
- self.assertRegexpMatches(err_out.getvalue(), os.path.join(pth_dir, pth_fn))
+ self.assertRegexpMatches(err_out.getvalue(),
+ re.escape(os.path.join(pth_dir, pth_fn)))
# XXX: ditto previous XXX comment.
self.assertRegexpMatches(err_out.getvalue(), 'Traceback')
self.assertRegexpMatches(err_out.getvalue(), 'TypeError')