nose

Pycharm - no tests were found?

只谈情不闲聊 提交于 2019-12-06 17:00:47
问题 I've been getting a No tests were found error in Pycharm and I can't figure out why I'm getting it... this is what I have for my point_test.py : import unittest import sys import os sys.path.insert(0, os.path.abspath('..')) from ..point import Point class TestPoint(unittest.TestCase): def setUp(self): pass def xyCheck(self,x,y): point = Point(x,y) self.assertEqual(x,point.x) self.assertEqual(y,point.y) and this point.py , what I'm trying to test: import unittest from .utils import check

2017年下学期仁爱版英语教学工作计划

北城以北 提交于 2019-12-06 16:08:22
一、学期教学目标: 学生应有较明确的英语学习动机和积极主动的学习态度。能听懂教师对有关熟悉话题的陈述并能参与讨论。七年级学生能阅读的简单读物和报纸杂志,克服生词障碍,理解大意。能根据阅读目的运用适当的阅读策略。能与他人合作,解决问题并报告结果,共同完成学习任务。 1、要面向全体学生,关注每个学生的情感,激发他们学习英语的兴趣,帮助他们建立学习的成就感和自信心,培养创新精神; 2、整体设计目标,体现灵活开放,目标设计以学生技能,语言知识,情感态度,学习策略和文化意识的发展为基础; 3、突出学生主体,尊重个体差异; 4、采用语法翻译法,让学生在老师的指导下,实现目标,感受语言带来的快乐; 5、注重过程评价,促进学生发展,建立能激励学生学习兴趣和自主学习能力发展的评价体系。 总之,让学生在使用英语中学习英语,让学生成为Good User而不仅是Learner。让英语成为学生学习生活中最实用的工具而非累赘,让他们在使用和学习英语的过程中体味到轻松和成功的快乐,而不是无尽的担忧和恐惧。 二、学生基本情况分析: 本学期我担任七年级234班的英语教学工作。少部分学生掌握了英语学习的一些基本方法,能够积极主动认真地学习,学习成绩较好。但还有少部分学生没有明确的学习目的,缺少学习的热情和主动性,自觉性较差,相应的学习习惯也差。主要原因是没有激发学生学习英语的兴趣,学生觉得英语学习是一种负担

2017年下学期仁爱版英语教学工作计划

为君一笑 提交于 2019-12-06 15:18:11
一、学期教学目标: 学生应有较明确的英语学习动机和积极主动的学习态度。能听懂教师对有关熟悉话题的陈述并能参与讨论。七年级学生能阅读的简单读物和报纸杂志,克服生词障碍,理解大意。能根据阅读目的运用适当的阅读策略。能与他人合作,解决问题并报告结果,共同完成学习任务。 1、要面向全体学生,关注每个学生的情感,激发他们学习英语的兴趣,帮助他们建立学习的成就感和自信心,培养创新精神; 2、整体设计目标,体现灵活开放,目标设计以学生技能,语言知识,情感态度,学习策略和文化意识的发展为基础; 3、突出学生主体,尊重个体差异; 4、采用语法翻译法,让学生在老师的指导下,实现目标,感受语言带来的快乐; 5、注重过程评价,促进学生发展,建立能激励学生学习兴趣和自主学习能力发展的评价体系。 总之,让学生在使用英语中学习英语,让学生成为Good User而不仅是Learner。让英语成为学生学习生活中最实用的工具而非累赘,让他们在使用和学习英语的过程中体味到轻松和成功的快乐,而不是无尽的担忧和恐惧。 二、学生基本情况分析: 本学期我担任七年级234班的英语教学工作。少部分学生掌握了英语学习的一些基本方法,能够积极主动认真地学习,学习成绩较好。但还有少部分学生没有明确的学习目的,缺少学习的热情和主动性,自觉性较差,相应的学习习惯也差。主要原因是没有激发学生学习英语的兴趣,学生觉得英语学习是一种负担

Problems installing NoseXUnit

南楼画角 提交于 2019-12-06 12:19:59
I tried to install NoseXUnit using pip. Trying to run nosetests with it ends with the following error message: # nosetests --with-nosexunit /usr/lib/python2.7/site-packages/nose-1.3.0-py2.7.egg/nose/plugins/manager.py:395: RuntimeWarning: Unable to load plugin nosexunit = nosexunit.plugin:NoseXUnit: (coverage 3.7.1 (/usr/lib/python2.7/site-packages), Requirement.parse('coverage==2.85')) RuntimeWarning) Usage: nosetests [options] nosetests: error: no such option: --with-nosexunit So it seems like there's a problem with "coverage" version - I have version 3.7.1 and for some reason it requires 2

How do I use PyMock and Nose with Django models?

拥有回忆 提交于 2019-12-06 11:12:42
问题 I'm trying to do TDD with PyMock, but I keep getting error when I use Nose and execute core.py from command line: "ERROR: Failure: ImportError (Settings cannot be imported, because environment variable DJA NGO_SETTINGS_MODULE is undefined.)" If I remove "from cms.models import Entry" from the unit test module I created, everything works fine, but I need to mock functionality in django module cms.models.Entry that I created. What am I doing wrong? Can this be done? 回答1: You do need DJANGO

Python unittest: Retry on failure with Nose?

岁酱吖の 提交于 2019-12-06 10:47:59
I have a test which randomly fails and I want to let it retry a number of times before sending an error message. I'm using python with Nose. I wrote the following, but unfortunately, even with the try/except handling, Nose returns an error when the test fails on the first try. def test_something(self): maxAttempts = 3 func = self.run_something attempt = 1 while True: if attempt == maxAttempts: yield func break else: try: yield func break except: attempt += 1 def run_something(self): #Do stuff Thanks By using a generator, you're giving nose maxAttempts tests to run. if any of them fail, the

Running python nose tests in virtual-env

我们两清 提交于 2019-12-06 08:19:46
I have a script go.py , which needs to run unit tests (with nose) on several different modules, each with their own virtual envs. How can I activate each virtual env prior to testing, and deactivate it after? i.e. I want to do this (pseudo-code): for fn in functions_to_test: activate(path_to_env) run_test(fn) deactivate() activate() Inside a virtual env, there is ./bin/activate_this.py This does what I want. So in go.py I say import os activate_this_file = os.path.join(env_dir,'bin/deactivate_this.py') execfile(activate_this_file, dict(__file__=activate_this_file)) run_test() I've currently

Specially named directories using nosetests

拟墨画扇 提交于 2019-12-06 07:59:47
Does nosetests treat directories with certain names differently? Is a src directory special? If I have a project whose source directory is named src , nosetests seems to work fine. However, if the directory is named anything else, nosetests reports a bunch of import errors. Here's what I did: run tests ~/src$ nosetests .. ---------------------------------------------------------------------- Ran 2 tests in 0.001s OK rename directory ~/src$ cd .. ~/$ mv src/ src2 rerun tests ~/$ cd src2 ~/src2$ nosetests E ====================================================================== ERROR: Failure:

Python test framework with support of non-fatal failures

妖精的绣舞 提交于 2019-12-06 04:37:20
问题 I'm evaluating "test frameworks" for automated system tests; so far I'm looking for a python framework. In py.test or nose I can't see something like the EXPECT macros I know from google testing framework. I'd like to make several assertions in one test while not aborting the test at the first failure. Am I missing something in these frameworks or does this not work? Does anybody have suggestions for python test framworks usable for automated system tests? 回答1: I was wanting something similar

Run Unittest On Main Django Database

狂风中的少年 提交于 2019-12-06 03:30:23
I'm looking for a way to run a full celery setup during django tests, asked in this other SO question After thinking about it, I think I could settle for running a unittest (it's more of an integration test) in which I run the test script against the main Django (development) database. Is there a way to write unittests, run them with Nose and do so against the main database? I imagine it would be a matter of telling Nose (or whatever other framework) about the django settings. I've looked at django-nose but wasn't able to find a way to tell it to use the main DB and not a test one. I don't