Create a temporary JSON file with sample data.
(temp_dir, sample_data_list)
| 96 | |
| 97 | @pytest.fixture |
| 98 | def temp_json_file(temp_dir, sample_data_list): |
| 99 | """Create a temporary JSON file with sample data.""" |
| 100 | filepath = os.path.join(temp_dir, "test_data.json") |
| 101 | with open(filepath, "w", encoding="utf-8") as f: |
| 102 | json.dump(sample_data_list, f, ensure_ascii=False, indent=2) |
| 103 | return filepath |
| 104 | |
| 105 | |
| 106 | @pytest.fixture |