Skip to content
Permalink
Browse files

Nose tests: display Python warnings

Most importantly, DeprecationWarnings should be seen during test
runs. Quoting Python documentation (version 3.5, section 29.5.5):

  To programmatically do the same as -Wd, use:

  warnings.simplefilter('default')

  (...)

  Having certain warnings ignored by default is done to prevent a user
  from seeing warnings that are only of interest to the developer.
  (...)

  The unittest module has been also updated to use the 'default' filter
  while running tests.

Certainly they had done so in the unittest runner. I couldn't find an
option for that within Nose.
  • Loading branch information...
gracinet committed Sep 7, 2018
1 parent 87aa612 commit 8e53576f0dc80d81807ba5f2debd1f95ff0501f3
Showing with 4 additions and 0 deletions.
  1. +2 −0 anyblok/scripts.py
  2. +2 −0 anyblok_nose/plugins.py
@@ -13,6 +13,7 @@
from anyblok.registry import RegistryManager, return_list
from anyblok._graphviz import ModelSchema, SQLSchema
from nose import main
import warnings
import sys
from os.path import join
from os import walk
@@ -147,6 +148,7 @@ def anyblok_updatedb():
def anyblok_nose():
"""Run nose unit test for the registry
"""
warnings.simplefilter('default')
registry = anyblok.start('nose', useseparator=True, unittest=True)

defaultTest = []
@@ -11,6 +11,7 @@
from os.path import normpath
from os import pardir
from os import walk
import warnings


def isindir(path, dirpath):
@@ -77,6 +78,7 @@ def options(self, parser, env):
def configure(self, options, conf):
super(AnyBlokPlugin, self).configure(options, conf)
if self.enabled:
warnings.simplefilter('default')
self.AnyBlokOptions = Arg2OptOptions(options)

def load_registry(self):

0 comments on commit 8e53576

Please sign in to comment.
You can’t perform that action at this time.