taucmdr.tests.test_launcher module

Tests that the tau launcher isolates TAU Commander from the user’s Python environment.

By default they test the launcher installed next to the running interpreter. Set __TAUCMDR_TEST_LAUNCHER__ to test another installation’s launcher.

class taucmdr.tests.test_launcher.LauncherTest(methodName='runTest')[source]

Bases: TestCase

Tests of the tau launcher script, run as a subprocess in a hostile environment.

_check_children_see_env(env, script)[source]
_classSetupFailed = False
_class_cleanups = []
_hostile_env(shadow=True, python_home=True)[source]

Return an environment that would break an unisolated TAU Commander.

Parameters:
  • shadow (bool) – Put shadow taucmdr and sitecustomize modules on PYTHONPATH.

  • python_home (bool) – Set PYTHONHOME to a directory that doesn’t exist.

_read_pager_env()[source]
_run(cmd, env)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

test_backstop_reexecs_isolated()[source]

Running python -m taucmdr without the launcher restarts Python in isolated mode.

test_environment_reaches_children()[source]

Programs started by tau see the user’s Python variables and the launcher’s path.

test_hostile_environment()[source]

The shadowed modules and Python variables don’t stop tau from running.

test_missing_python()[source]

A launcher with no Python next to it exits with an explanation.

test_shebang()[source]

The launcher is a POSIX sh script.

test_symlinked_launcher()[source]

Absolute, relative and chained symlinks, in a directory with a space, all find the real launcher.

taucmdr.tests.test_launcher._write(path, text)[source]