File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 16
16
import sys
17
17
18
18
import nox
19
+ import os
20
+ import shutil
21
+ from shutil import rmtree
19
22
20
23
test_dependencies = [
21
24
"django>=2.0.0" ,
@@ -58,9 +61,22 @@ def lint(session):
58
61
],
59
62
)
60
63
def unit (session , oauth2client ):
64
+ # Clean up dist and build folders
65
+ rmtree ('dist' , ignore_errors = True )
66
+ rmtree ('build' , ignore_errors = True )
67
+
61
68
session .install (* test_dependencies )
62
69
session .install (oauth2client )
63
- session .install ('.' )
70
+
71
+ # Create and install wheels
72
+ session .run ('python3' , 'setup.py' , 'bdist_wheel' )
73
+ session .install (os .path .join ('dist' , os .listdir ('dist' ).pop ()))
74
+
75
+ # Run tests from a different directory to test the package artifacts
76
+ root_dir = os .path .dirname (os .path .realpath (__file__ ))
77
+ temp_dir = session .create_tmp ()
78
+ session .chdir (temp_dir )
79
+ shutil .copytree (os .path .join (root_dir , 'tests' ), 'tests' )
64
80
65
81
# Run py.test against the unit tests.
66
82
session .run (
You can’t perform that action at this time.
0 commit comments