Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • W wendelin.core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Commits
Collapse sidebar
  • Kirill Smelkov
  • wendelin.core
  • Repository
  • wendelin.core
  • bigarray
  • tests
  • test_basic.py
Find file BlameHistoryPermalink
  • Kirill Smelkov's avatar
    */tests: Use pytest.raises in modern way · b12e319e
    Kirill Smelkov authored Jul 12, 2019
    Instead of
    
    	raises(Exception, 'code')
    
    do
    
    	with raises(Exception):
    		code
    
    This removes lots of warnings, similar to below example:
    
    	bigfile/tests/test_basic.py::test_basic
    	  /home/kirr/src/wendelin/wendelin.core/bigfile/tests/test_basic.py:79: PytestDeprecationWarning: raises(..., 'code(as_a_string)') is deprecated, use the context manager form or use `exec()` directly
    
    	  See https://docs.pytest.org/en/latest/deprecations.html#raises-warns-exec
    	    raises(ROAttributeError, "f.blksize = 1") # RO attribute
    b12e319e
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7