pydev

pytest not discovering test in pyDev

风流意气都作罢 提交于 2019-12-13 02:57:19
问题 I'm trying to build and run (selenium which is not relevant) test-suite with pytest framework. I wrote a simple test as follows class test_pqr(): def test_lmn(self): print("AAAAAAAAAAAAAAAAAAAAA") assert True def test_xyz(self): assert False x= test_pqr() x.test_lmn() when I run it I got result... if I run xyz as well... eg class test_pqr(): def test_lmn(self): print("AAAAAAAAAAAAAAAAAAAAA") assert True def test_xyz(self): assert False x= test_pqr() x.test_lmn() x.test_xyz() get results as...

Eclipse PyDev Autocomplete Issues

久未见 提交于 2019-12-12 23:15:30
问题 I installed PyDev in Eclipse on my Mac. Whenever I am writing code, it has only a few suggestions and is seemingly incomplete. For example, whenever I type 'r', it only suggests "raise()" and "return()". However, all of the other functions that I would expect for it to suggest still execute at runtime. This is the error: Error connecting to python process. - the process in NOT ALIVE anymore (output=0) - ProcessInfo: Executed: /usr/bin/python -u /Users//Downloads/eclipse 2/plugins/org.python

pygame.init() shows as undefined variable after installing Pygame

↘锁芯ラ 提交于 2019-12-12 21:03:11
问题 I'm trying to write a sample Python application using Pygame: import pygame, sys from pygame.locals import * pygame.init() DISPLAYSURF = pygame.display.set_mode((400, 300)) pygame.display.set_caption('Hello world!') while True: # main game loop for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() pygame.display.update() However, PyDev complains that init() is an undefined variable even though it recognizes the Pygame library. I'm using Python 2.7.6 as the

Does Eclipse PyDev (Jython) pull classpath from M2Eclipse?

人走茶凉 提交于 2019-12-12 18:34:19
问题 While trying to run Jython Scripts in Eclipse using PyDev, I noticed that the Jython run configuration was not pulling the java classpath value from maven/m2eclipse. Has anybody configured eclipse so that PyDev pulls the correct classpath from maven? Notes: I can in fact run jython scripts, and import classes from the jre, but my maven dependencies do not appear on the classpath when interpreting the Jython scripts I have seen the question/answer Using Jython with M2Eclipse and have used

How to define an external source folder in .pydevproject?

为君一笑 提交于 2019-12-12 17:13:53
问题 Are there any examples of how to add an external source directory to the pythonpath in the .pydevproject file? The pydev UI appears to require string substitution variables for this, which I have not been able to get working. Thanks! -Travis 回答1: You can add them as External Libs . Project Properties > Pydev - PYTHONPATH > External Libraries > Add Source Folder 回答2: For completeness, here's the .pydevproject code that gets this working: <pydev_pathproperty name="org.python.pydev.PROJECT

Set comprehensions don't work on Pydev (Python)

半世苍凉 提交于 2019-12-12 13:41:23
问题 {x for x in range(10)} works perfectly on IDLE, but when I try this in eclipse (with Pydev plugin) I get a syntax error: Undefined variable: x Is it because Pydev doesn't support set comprehensions or something? What can I do to make this work? (This was just one example that doesn't work. All set comprehensions don't work for me). (I'm using Python 3) 回答1: This is a bug in PyDev; in this case ignore the editor's warning and execute the code: it will work. I get this a lot, PyDev isn't

Unit testing entire project hierarchy in Python using unittest in pydev

与世无争的帅哥 提交于 2019-12-12 11:25:09
问题 I am using unittest module to unit test some python code that has been created in a hierarchical struture of packages using Pydev. The problem arises as I try to use separate source folders for actual source code and its unit test in pydev. project |----src | |----com | | |----myself | | | |----MyApplication | | | | |----SampleFileToTest.py => The application file that I want to test |----test | |----com | | |----myself | | | |----MyApplication | | | | |----TestTheSampleFileToTest.py => My

How to increase verbosity in python unittest?

只谈情不闲聊 提交于 2019-12-12 10:49:35
问题 I have a test case class like this one: import unittest import sys class Test(unittest.TestCase): def test_a(self): pass def test_b(self): pass # etc if __name__ == "__main__": unittest.main(verbosity=2) This is a file in eclipse using PyDev. I run it as unittest . Somehow the verbosity option does not trigger. There are no errors. What do I miss? 回答1: I figured out, that the Answer is in the eclipse configuration and not in the source code. Open Preferences -> PyDev -> PyUnit and adjust the

Fake unresolved import error in PyDev

对着背影说爱祢 提交于 2019-12-12 10:48:16
问题 PyDev is reporting import errors which don't exist. The initial symptom was a fake "unresolved import" error, which was fixed by some combination of: Cleaning the Project Re-indexing the project (remove interpreter, add again) Restarting Eclipse Burning incense to the Python deities Now the error is "unverified variable from import"--it can't seem to find pymssql.connect. This IS NOT a PYHTONPATH problem. I can access the module just fine, the code in the file with the (alleged) error runs

How do I suppress “unused in wild import” warning in pydev?

别来无恙 提交于 2019-12-12 09:34:12
问题 How do I suppress "unused in wild import" warning in pydev? 回答1: Suppressing warning message for import / wild import from django.db import connection #@UnusedImport from django.db import * #@UnusedWildImport 来源: https://stackoverflow.com/questions/3215516/how-do-i-suppress-unused-in-wild-import-warning-in-pydev