PATH:
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
testfixtures
/
tests
.. invisible-code-block: python # change to the temp directory import os original_dir = os.getcwd() os.chdir(tempdir.path) To construct a configuration file using the :mod:`ConfigParser` module, you would do the following: .. code-block:: python from configparser import ConfigParser config = ConfigParser() config.add_section('A Section') config.set('A Section', 'dir', 'frob') f = open('example.cfg','w') config.write(f) f.close() The generated configuration file will be as follows: .. topic:: example.cfg :class: read-file :: [A Section] dir = frob .. config parser writes whitespace at the end, be careful when testing! .. invisible-code-block: python # change out again import os os.chdir(original_dir)
[-] test_should_raise.py
[open]
[-] test_twisted.py
[open]
[-] sample1.py
[open]
[+]
..
[-] test_shouldwarn.py
[open]
[-] test_time.py
[open]
[-] test_mappingcomparison.py
[open]
[+]
__pycache__
[-] test_datetime.py
[open]
[-] directory-contents.txt
[open]
[-] test_tempdir.py
[open]
[-] test_replace.py
[open]
[-] test_logcapture.py
[open]
[-] test_generator.py
[open]
[-] test_sybil.py
[open]
[-] test_sequencecomparison.py
[open]
[-] test_mock.py
[open]
[-] test_compare.py
[open]
[-] test_components.py
[open]
[-] test_popen.py
[open]
[+]
test_django
[-] configparser-read.txt
[open]
[-] test_outputcapture.py
[open]
[-] test_date.py
[open]
[-] sample3.py
[open]
[-] test_tempdirectory.py
[open]
[-] test_replacer.py
[open]
[-] configparser-write.txt
[open]
[-] test_stringcomparison.py
[open]
[-] sample2.py
[open]
[-] test_roundcomparison.py
[open]
[-] __init__.py
[open]
[-] test_comparison.py
[open]
[-] test_diff.py
[open]
[-] test_wrap.py
[open]
[-] test_rangecomparison.py
[open]
[-] test_log_capture.py
[open]
[-] test_popen_docs.py
[open]