Skip to content

Commit

Permalink
Pass string to create_corpus_for_testing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boomanaiden154 committed Jan 29, 2025
1 parent a59ca65 commit 59a5478
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler_opt/es/blackbox_evaluator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_trace_get_results(self):
blackbox_test_utils.ESTraceWorker, count=3, arg='', kwarg='') as pool:
perturbations = [b'00', b'01', b'10']
test_corpus = corpus.create_corpus_for_testing(
location=self.create_tempdir(),
location=self.create_tempdir().full_path,
elements=[corpus.ModuleSpec(name='name1', size=1)])
evaluator = blackbox_evaluator.TraceBlackboxEvaluator(
test_corpus, 5, 'fake_bb_trace_path', 'fake_function_index_path')
Expand All @@ -68,7 +68,7 @@ def test_trace_set_baseline(self):
with local_worker_manager.LocalWorkerPoolManager(
blackbox_test_utils.ESTraceWorker, count=1, arg='', kwarg='') as pool:
test_corpus = corpus.create_corpus_for_testing(
location=self.create_tempdir(),
location=self.create_tempdir().full_path,
elements=[corpus.ModuleSpec(name='name1', size=1)])
evaluator = blackbox_evaluator.TraceBlackboxEvaluator(
test_corpus, 5, 'fake_bb_trace_path', 'fake_function_index_path')
Expand Down

0 comments on commit 59a5478

Please sign in to comment.