pycharm-未找到测试? [英] Pycharm - no tests were found?

查看:203
本文介绍了pycharm-未找到测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了

未找到测试

No tests were found

皮查姆(Pycharm)中的错误,我不知道为什么要得到它...这就是我的point_test.py所拥有的:

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)

和这个point.py,我要测试的是:

and this point.py, what I'm trying to test:

import unittest

from .utils import check_coincident, shift_point

class Point(object):
    def __init__(self,x,y,mark={}):
        self.x = x
        self.y = y
        self.mark = mark

    def patched_coincident(self,point2):
        point1 = (self.x,self.y)
        return check_coincident(point1,point2)

    def patched_shift(self,x_shift,y_shift):
        point = (self.x,self.y)
        self.x,self,y = shift_point(point,x_shift,y_shift)

我的运行配置有问题吗?我看了这篇文章,但我仍然很困惑.我的运行配置当前如下所示:

Is it something wrong with my run configuration? I looked at this SO post but I'm still utterly confused. My run configuration currently looks like this:

我想我只是明白我可能做错了什么?任何帮助将不胜感激,谢谢!

I guess I just understand what I could be doing wrong? Any help would be greatly appreciated, thanks!!

推荐答案

为了识别测试功能,在您的情况下必须将其命名为test_xyCheck重命名为test_xyCheck:)

in order to recognize test functions they must be named test_ in your case rename xyCheck to test_xyCheck :)

这篇关于pycharm-未找到测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆