/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)
.
Edit
..
Edit
__init__.py
Edit
__pycache__
Edit
configparser-read.txt
Edit
configparser-write.txt
Edit
directory-contents.txt
Edit
sample1.py
Edit
sample2.py
Edit
sample3.py
Edit
test_compare.py
Edit
test_comparison.py
Edit
test_components.py
Edit
test_date.py
Edit
test_datetime.py
Edit
test_diff.py
Edit
test_django
Edit
test_generator.py
Edit
test_log_capture.py
Edit
test_logcapture.py
Edit
test_mappingcomparison.py
Edit
test_mock.py
Edit
test_outputcapture.py
Edit
test_popen.py
Edit
test_popen_docs.py
Edit
test_rangecomparison.py
Edit
test_replace.py
Edit
test_replacer.py
Edit
test_roundcomparison.py
Edit
test_sequencecomparison.py
Edit
test_should_raise.py
Edit
test_shouldwarn.py
Edit
test_stringcomparison.py
Edit
test_sybil.py
Edit
test_tempdir.py
Edit
test_tempdirectory.py
Edit
test_time.py
Edit
test_twisted.py
Edit
test_wrap.py
Edit