Skip to content

Commit 88a26db

Browse files
janeyx99pytorchmergebot
authored andcommitted
[BE] simplify test_cpp_extensions_aot and .gitignore (pytorch#149231)
It is shady to clean up an install mid-test. So don't do that anymore and use .gitignore instead. Pull Request resolved: pytorch#149231 Approved by: https://github.com/albanD, https://github.com/msaroufim
1 parent b99fc9d commit 88a26db

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ test/forward_backward_compatibility/nightly_schemas.txt
6262
dropout_model.pt
6363
test/generated_type_hints_smoketest.py
6464
test/htmlcov
65-
test/cpp_extensions/install/
66-
test/cpp_extensions/open_registration_extension/install
67-
test/cpp_extensions/libtorch_agnostic_extension/install
65+
test/cpp_extensions/**/install
6866
test/kernel.errors.txt
6967
third_party/build/
7068
third_party/nccl/

test/test_cpp_extensions_aot.py

-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import os
44
import re
55
import subprocess
6-
import sys
76
import unittest
87
from itertools import repeat
98
from pathlib import Path
@@ -16,7 +15,6 @@
1615
from torch.testing._internal.common_cuda import TEST_CUDA
1716
from torch.testing._internal.common_utils import (
1817
IS_WINDOWS,
19-
shell,
2018
skipIfTorchDynamo,
2119
TEST_XPU,
2220
xfailIfTorchDynamo,
@@ -217,16 +215,6 @@ def test_python_agnostic(self):
217215
missing_symbols = subprocess.check_output(["nm", "-u", so_file]).decode("utf-8")
218216
self.assertFalse("Py" in missing_symbols)
219217

220-
# finally, clean up the folder
221-
cmd = [sys.executable, "setup.py", "clean"]
222-
return_code = shell(
223-
cmd,
224-
cwd=os.path.join("cpp_extensions", "python_agnostic_extension"),
225-
env=os.environ.copy(),
226-
)
227-
if return_code != 0:
228-
return return_code
229-
230218
@unittest.skipIf(not TEST_CUDA, "some aspects of this test require CUDA")
231219
def test_libtorch_agnostic(self):
232220
import libtorch_agnostic

0 commit comments

Comments
 (0)