@@ -75,7 +75,7 @@ def data(self) -> Dict[str, Any]:
7575
7676 def clear_data_cache (self ) -> None :
7777 """Drop the data cache."""
78- del self .data
78+ self .__dict__ . pop ( " data" , None )
7979
8080 def collect (
8181 self : Self ,
@@ -85,22 +85,21 @@ def collect(
8585 loaded_file = self .data
8686 except Exception :
8787 return # Skip *.json files that are unreadable.
88- if not isinstance (loaded_file , dict ):
89- return
90- for key , test_dict in loaded_file .items ():
91- if not isinstance (test_dict , dict ):
92- continue
93- for fixture_type in ALL_FIXTURE_TYPES :
94- if not fixture_type .is_format (test_dict ):
88+ if isinstance (loaded_file , dict ):
89+ for key , test_dict in loaded_file .items ():
90+ if not isinstance (test_dict , dict ):
9591 continue
96- name = key
97- if "::" in name :
98- name = name .split ("::" )[1 ]
99- yield fixture_type .from_parent ( # type: ignore
100- parent = self ,
101- name = name ,
102- test_file = str (self .path ),
103- test_key = key ,
104- )
92+ for fixture_type in ALL_FIXTURE_TYPES :
93+ if not fixture_type .is_format (test_dict ):
94+ continue
95+ name = key
96+ if "::" in name :
97+ name = name .split ("::" )[1 ]
98+ yield fixture_type .from_parent ( # type: ignore
99+ parent = self ,
100+ name = name ,
101+ test_file = str (self .path ),
102+ test_key = key ,
103+ )
105104 # Make sure we don't keep anything from collection in memory.
106105 self .clear_data_cache ()
0 commit comments