Skip to content

Commit 59a5478

Browse files
Pass string to create_corpus_for_testing
We use the TF test abstractions for the actual corpus tests, which is where I mostly copied the create_corpus_for_testing calls. Everything still works, but pytype in some environments will complain since absl test's create_tempdir() actually returns an internal _Tempdir object which is not equivalent to a string. Simply access the full_path property to get a string and make the type checker happy.
1 parent a59ca65 commit 59a5478

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler_opt/es/blackbox_evaluator_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_trace_get_results(self):
5656
blackbox_test_utils.ESTraceWorker, count=3, arg='', kwarg='') as pool:
5757
perturbations = [b'00', b'01', b'10']
5858
test_corpus = corpus.create_corpus_for_testing(
59-
location=self.create_tempdir(),
59+
location=self.create_tempdir().full_path,
6060
elements=[corpus.ModuleSpec(name='name1', size=1)])
6161
evaluator = blackbox_evaluator.TraceBlackboxEvaluator(
6262
test_corpus, 5, 'fake_bb_trace_path', 'fake_function_index_path')
@@ -68,7 +68,7 @@ def test_trace_set_baseline(self):
6868
with local_worker_manager.LocalWorkerPoolManager(
6969
blackbox_test_utils.ESTraceWorker, count=1, arg='', kwarg='') as pool:
7070
test_corpus = corpus.create_corpus_for_testing(
71-
location=self.create_tempdir(),
71+
location=self.create_tempdir().full_path,
7272
elements=[corpus.ModuleSpec(name='name1', size=1)])
7373
evaluator = blackbox_evaluator.TraceBlackboxEvaluator(
7474
test_corpus, 5, 'fake_bb_trace_path', 'fake_function_index_path')

0 commit comments

Comments
 (0)