Coverage for tests/not_used_example_structure_factor.py: 27%
11 statements
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-14 15:55 +0200
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-14 15:55 +0200
1""" This test ensure that the example works as intended """
2import os
3import matplotlib
5def not_example_structure_factor():
6 # Use the non-interactive Agg Matplotlib backend to avoid interactive graphical interface
7 matplotlib.get_backend()
8 os.environ['MPLBACKEND'] = 'Agg'
9 matplotlib.use('Agg')
11 # Run the example
12 example_folder = 'examples'
13 example_script = 'structure_factor.py'
14 example_path = os.path.join(example_folder, example_script)
15 with open(example_path, 'r') as script:
16 exec(script.read(), globals())
18#if __name__ == '__main__':
19# test_example_structure_factor()