Skip to content

Commit 03a438a

Browse files
committed
Fix syntax issue
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
1 parent f2dd261 commit 03a438a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/kitchen/verifier/nox.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Nox < Kitchen::Verifier::Base
3333
default_config :sys_stats, false
3434
default_config :environment_vars, {}
3535
default_config :zip_windows_artifacts, false
36+
default_config :pytest_nox_session, false
3637

3738
def call(state)
3839
create_sandbox
@@ -113,6 +114,12 @@ def call(state)
113114
noxenv = "pytest-zeromq"
114115
end
115116

117+
if noxenv.start_with?("test-")
118+
config[:pytest_nox_session] = true
119+
elsif noxenv.include?("pytest")
120+
config[:pytest_nox_session] = true
121+
end
122+
116123
# Is the nox env already including the Python version?
117124
if not noxenv.match(/^(.*)-([\d]{1})(\.([\d]{1}))?$/)
118125
# Nox env's are not py<python-version> named, they just use the <python-version>
@@ -125,7 +132,7 @@ def call(state)
125132
end
126133
noxenv = "#{noxenv}(coverage=#{config[:coverage] ? 'True' : 'False'})"
127134

128-
if noxenv.start_with?("test-") || noxenv.include? "pytest"
135+
if config[:pytest_nox_session]
129136
tests = config[:tests].join(' ')
130137
if config[:sys_stats]
131138
sys_stats = '--sys-stats'
@@ -142,7 +149,7 @@ def call(state)
142149

143150
if config[:junitxml]
144151
junitxml = File.join(root_path, config[:testingdir], 'artifacts', 'xml-unittests-output')
145-
if noxenv.start_with?("test-") || noxenv.include? "pytest"
152+
if config[:pytest_nox_session]
146153
junitxml = "--junitxml=#{File.join(junitxml, "test-results-#{DateTime.now.strftime('%Y%m%d%H%M%S.%L')}.xml")}"
147154
else
148155
junitxml = "--xml=#{junitxml}"

0 commit comments

Comments
 (0)