@pytest.mark.cmd
def test_test_checks_noargs():
 with pytest.raises(CommandError) as e:
  call_command('test_checks')
 assert ('Either --unit or a pair of --source and --target must be provided.' in str(e))

@ pytest . mark . cmd def test_test_checks_noargs ( ) : with pytest . raises ( CommandError ) as e : call_command ( 'test_checks' ) assert ( 'Either --unit or a pair of --source and --target must be provided.' in str ( e ) )
no args should fail wanting either --unit or --source .