Commit Graph

11 Commits

Author SHA1 Message Date
bf7e290854 Add __main__ guards to jit tests (#154725)
This PR is part of a series attempting to re-submit https://github.com/pytorch/pytorch/pull/134592 as smaller PRs.

In jit tests:

- Add and use a common raise_on_run_directly method for when a user runs a test file directly which should not be run this way. Print the file which the user should have run.
- Raise a RuntimeError on tests which have been disabled (not run)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/154725
Approved by: https://github.com/clee2000
2025-06-16 10:28:45 +00:00
20912673a6 Revert "Add __main__ guards to jit tests (#154725)"
This reverts commit 1a55fb0ee87eaa8b376aaa82d95d213fe0fbe64b.

Reverted https://github.com/pytorch/pytorch/pull/154725 on behalf of https://github.com/malfet due to This added 2nd copy of raise_on_run to common_utils.py which caused lint failures, see https://github.com/pytorch/pytorch/actions/runs/15445374980/job/43473457466 ([comment](https://github.com/pytorch/pytorch/pull/154725#issuecomment-2940503905))
2025-06-04 15:42:52 +00:00
1a55fb0ee8 Add __main__ guards to jit tests (#154725)
This PR is part of a series attempting to re-submit https://github.com/pytorch/pytorch/pull/134592 as smaller PRs.

In jit tests:

- Add and use a common raise_on_run_directly method for when a user runs a test file directly which should not be run this way. Print the file which the user should have run.
- Raise a RuntimeError on tests which have been disabled (not run)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/154725
Approved by: https://github.com/Skylion007
2025-06-04 14:44:08 +00:00
6ff1e43a41 [BE][Easy][13/19] enforce style for empty lines in import segments in test/j*/ (#129764)
See https://github.com/pytorch/pytorch/pull/129751#issue-2380881501. Most changes are auto-generated by linter.

You can review these PRs via:

```bash
git diff --ignore-all-space --ignore-blank-lines HEAD~1
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/129764
Approved by: https://github.com/ezyang
2024-08-01 12:13:42 +00:00
604c9c5601 Enable UFMT on all of test/jit (#123623)
Partially addresses #123062

Ran lintrunner on:

- `test/jit`

with command:

```bash
lintrunner -a --take UFMT --all-files
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/123623
Approved by: https://github.com/ezyang
2024-04-11 23:45:05 +00:00
fdaf393ec1 [EASY] [JIT]Cleaning up the device analysis temp test code
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71626

Approved by: https://github.com/Krovatkin
2022-04-25 15:50:52 +00:00
b40dbdc49f Fix test ownership lint (#71554)
Summary:
I noticed after creating https://github.com/pytorch/pytorch/issues/71553 that the test ownership lint was not working properly.

This fixes my egregious mistake and fixes the broken lints.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/71554

Reviewed By: malfet

Differential Revision: D33690732

Pulled By: janeyx99

fbshipit-source-id: ba4dfbcd98038e4afd63e326832ae40935d2501e
(cherry picked from commit 1bbc3d343ac143f10b3d4052496812fccfd9e853)
2022-01-21 18:24:42 +00:00
ed9804088a Adding support for loops (#70209)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/70209

Test Plan: Imported from OSS

Reviewed By: anjali411

Differential Revision: D33555889

Pulled By: Gamrix

fbshipit-source-id: f6c0c9d517849e3679e07ac1c8cf3bf367e91882
2022-01-13 13:59:25 -08:00
18d91a97e4 Adding custom device type change rules (#69051)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69051

Test Plan: Imported from OSS

Reviewed By: anjali411

Differential Revision: D33555884

Pulled By: Gamrix

fbshipit-source-id: c38812277d0e2aa008903a4328cb72e34bc6e1e6
2022-01-13 13:59:21 -08:00
03c4d2b9e3 Adding support for Ifs in Device Type Analysis (#69050)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69050

Test Plan: Imported from OSS

Reviewed By: anjali411

Differential Revision: D33555887

Pulled By: Gamrix

fbshipit-source-id: f7f057c5985f8b6e7a9fe5702a944b2b4cc4d5b5
2022-01-13 13:59:18 -08:00
dabcbb2726 Testing for Default Inference for Device Type (#69052)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69052

Test Plan: Imported from OSS

Reviewed By: anjali411

Differential Revision: D33555888

Pulled By: Gamrix

fbshipit-source-id: dbd43ebfc1bea4b17a96bdd378ea730ccf5944b2
2022-01-13 13:59:12 -08:00