Skip to content

Commit

Permalink
Filter ignored tests by marker instead of keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Jun 8, 2016
1 parent dfc1cd7 commit 2f3633a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rake-tasks/crazy_fun/mappings/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ def handle(fun, dir, args)
# Test file pattern has been specified in the pytest.ini file at project root dir
test_dir = ["#{Python::lib_dir}/selenium/test/selenium/webdriver/#{browser_data[:dir]}/"]
pytest_args = [pytest_path] + test_dir
ignores = "-ignore_#{browser_data[:ignore]}" if browser_data[:ignore]
ignores += " and " + ENV['method'] if ENV['method']
pytest_args += ["-k=\"" + ignores + "\""]
mark_filter = "-m=\"not ignore_#{browser_data[:ignore]}\"" if browser_data[:ignore]
pytest_args += [mark_filter]
keyword_filter = "-k=" + ENV['method'] if ENV['method']
pytest_args += [keyword_filter]
pytest_args += ["--junitxml=build/test_logs/python-#{browser}-#{Time.now.to_i}.xml"]
mkdir_p "build/test_logs"
sh pytest_args.join(' '), :verbose => true
Expand Down

0 comments on commit 2f3633a

Please sign in to comment.