Skip to content

Commit 121f031

Browse files
committed
Filter ignored tests by marker instead of keyword
1 parent 0bb2168 commit 121f031

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rake-tasks/crazy_fun/mappings/python.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,10 @@ def handle(fun, dir, args)
156156
# Test file pattern has been specified in the pytest.ini file at project root dir
157157
test_dir = ["#{Python::lib_dir}/selenium/test/selenium/webdriver/#{browser_data[:dir]}/"]
158158
pytest_args = [pytest_path] + test_dir
159-
ignores = "-ignore_#{browser_data[:ignore]}" if browser_data[:ignore]
160-
ignores += " and " + ENV['method'] if ENV['method']
161-
pytest_args += ["-k=\"" + ignores + "\""]
159+
mark_filter = "-m=\"not ignore_#{browser_data[:ignore]}\"" if browser_data[:ignore]
160+
pytest_args += [mark_filter]
161+
keyword_filter = "-k=" + ENV['method'] if ENV['method']
162+
pytest_args += [keyword_filter]
162163
pytest_args += ["--junitxml=build/test_logs/python-#{browser}-#{Time.now.to_i}.xml"]
163164
mkdir_p "build/test_logs"
164165
sh pytest_args.join(' '), :verbose => true

0 commit comments

Comments
 (0)