【发布时间】:2022-05-06 06:44:33
【问题描述】:
我在 PyCharm 中遇到了一个错误,我不知道为什么会这样:
没有找到测试
这就是我的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,我正在尝试测试:
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)
我的运行配置有问题吗?我查看了this SO 帖子,但我仍然非常困惑。我的运行配置目前如下所示:
【问题讨论】:
-
也许这对你有用:intellij-support.jetbrains.com/hc/en-us/community/posts/… 停止在测试模式下运行。
标签: python unit-testing pycharm