Skip to content

Commit b0cce8a

Browse files
committed
Re-use FilesSpec from _path.
1 parent 5ff3f3b commit b0cce8a

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

tests/fixtures.py

+9-16
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
import contextlib
1010

1111
from .py39compat import FS_NONASCII
12-
from typing import Dict, Union
1312

1413
from . import _path
14+
from ._path import FilesSpec
1515

1616

1717
try:
@@ -85,15 +85,8 @@ def setUp(self):
8585
self.fixtures.enter_context(self.add_sys_path(self.site_dir))
8686

8787

88-
# Except for python/mypy#731, prefer to define
89-
# FilesDef = Dict[str, Union['FilesDef', str, bytes]]
90-
FilesDef = Dict[
91-
str, Union[Dict[str, Union[Dict[str, Union[str, bytes]], str, bytes]], str, bytes]
92-
]
93-
94-
9588
class DistInfoPkg(OnSysPath, SiteDir):
96-
files: FilesDef = {
89+
files: FilesSpec = {
9790
"distinfo_pkg-1.0.0.dist-info": {
9891
"METADATA": """
9992
Name: distinfo-pkg
@@ -135,7 +128,7 @@ def make_uppercase(self):
135128

136129

137130
class DistInfoPkgWithDot(OnSysPath, SiteDir):
138-
files: FilesDef = {
131+
files: FilesSpec = {
139132
"pkg_dot-1.0.0.dist-info": {
140133
"METADATA": """
141134
Name: pkg.dot
@@ -150,7 +143,7 @@ def setUp(self):
150143

151144

152145
class DistInfoPkgWithDotLegacy(OnSysPath, SiteDir):
153-
files: FilesDef = {
146+
files: FilesSpec = {
154147
"pkg.dot-1.0.0.dist-info": {
155148
"METADATA": """
156149
Name: pkg.dot
@@ -177,7 +170,7 @@ def setUp(self):
177170

178171

179172
class EggInfoPkg(OnSysPath, SiteDir):
180-
files: FilesDef = {
173+
files: FilesSpec = {
181174
"egginfo_pkg.egg-info": {
182175
"PKG-INFO": """
183176
Name: egginfo-pkg
@@ -217,7 +210,7 @@ def setUp(self):
217210

218211

219212
class EggInfoPkgPipInstalledNoToplevel(OnSysPath, SiteDir):
220-
files: FilesDef = {
213+
files: FilesSpec = {
221214
"egg_with_module_pkg.egg-info": {
222215
"PKG-INFO": "Name: egg_with_module-pkg",
223216
# SOURCES.txt is made from the source archive, and contains files
@@ -252,7 +245,7 @@ def setUp(self):
252245

253246

254247
class EggInfoPkgPipInstalledNoModules(OnSysPath, SiteDir):
255-
files: FilesDef = {
248+
files: FilesSpec = {
256249
"egg_with_no_modules_pkg.egg-info": {
257250
"PKG-INFO": "Name: egg_with_no_modules-pkg",
258251
# SOURCES.txt is made from the source archive, and contains files
@@ -282,7 +275,7 @@ def setUp(self):
282275

283276

284277
class EggInfoPkgSourcesFallback(OnSysPath, SiteDir):
285-
files: FilesDef = {
278+
files: FilesSpec = {
286279
"sources_fallback_pkg.egg-info": {
287280
"PKG-INFO": "Name: sources_fallback-pkg",
288281
# SOURCES.txt is made from the source archive, and contains files
@@ -308,7 +301,7 @@ def setUp(self):
308301

309302

310303
class EggInfoFile(OnSysPath, SiteDir):
311-
files: FilesDef = {
304+
files: FilesSpec = {
312305
"egginfo_file.egg-info": """
313306
Metadata-Version: 1.0
314307
Name: egginfo_file

0 commit comments

Comments
 (0)