CHANGELOG.rst 278 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872
  1. =================
  2. Changelog history
  3. =================
  4. Versions follow `Semantic Versioning <https://semver.org/>`_ (``<major>.<minor>.<patch>``).
  5. Backward incompatible (breaking) changes will only be introduced in major versions
  6. with advance notice in the **Deprecations** section of releases.
  7. ..
  8. You should *NOT* be adding new change log entries to this file, this
  9. file is managed by towncrier. You *may* edit previous change logs to
  10. fix problems like typo corrections or such.
  11. To add a new change log entry, please see
  12. https://pip.pypa.io/en/latest/development/#adding-a-news-entry
  13. we named the news folder changelog
  14. .. towncrier release notes start
  15. pytest 4.6.11 (2020-06-04)
  16. ==========================
  17. Bug Fixes
  18. ---------
  19. - `#6334 <https://github.com/pytest-dev/pytest/issues/6334>`_: Fix summary entries appearing twice when ``f/F`` and ``s/S`` report chars were used at the same time in the ``-r`` command-line option (for example ``-rFf``).
  20. The upper case variants were never documented and the preferred form should be the lower case.
  21. - `#7310 <https://github.com/pytest-dev/pytest/issues/7310>`_: Fix ``UnboundLocalError: local variable 'letter' referenced before
  22. assignment`` in ``_pytest.terminal.pytest_report_teststatus()``
  23. when plugins return report objects in an unconventional state.
  24. This was making ``pytest_report_teststatus()`` skip
  25. entering if-block branches that declare the ``letter`` variable.
  26. The fix was to set the initial value of the ``letter`` before
  27. the if-block cascade so that it always has a value.
  28. pytest 4.6.10 (2020-05-08)
  29. ==========================
  30. Features
  31. --------
  32. - `#6870 <https://github.com/pytest-dev/pytest/issues/6870>`_: New ``Config.invocation_args`` attribute containing the unchanged arguments passed to ``pytest.main()``.
  33. Remark: while this is technically a new feature and according to our `policy <https://docs.pytest.org/en/latest/py27-py34-deprecation.html#what-goes-into-4-6-x-releases>`_ it should not have been backported, we have opened an exception in this particular case because it fixes a serious interaction with ``pytest-xdist``, so it can also be considered a bugfix.
  34. Trivial/Internal Changes
  35. ------------------------
  36. - `#6404 <https://github.com/pytest-dev/pytest/issues/6404>`_: Remove usage of ``parser`` module, deprecated in Python 3.9.
  37. pytest 4.6.9 (2020-01-04)
  38. =========================
  39. Bug Fixes
  40. ---------
  41. - `#6301 <https://github.com/pytest-dev/pytest/issues/6301>`_: Fix assertion rewriting for egg-based distributions and ``editable`` installs (``pip install --editable``).
  42. pytest 4.6.8 (2019-12-19)
  43. =========================
  44. Features
  45. --------
  46. - `#5471 <https://github.com/pytest-dev/pytest/issues/5471>`_: JUnit XML now includes a timestamp and hostname in the testsuite tag.
  47. Bug Fixes
  48. ---------
  49. - `#5430 <https://github.com/pytest-dev/pytest/issues/5430>`_: junitxml: Logs for failed test are now passed to junit report in case the test fails during call phase.
  50. Trivial/Internal Changes
  51. ------------------------
  52. - `#6345 <https://github.com/pytest-dev/pytest/issues/6345>`_: Pin ``colorama`` to ``0.4.1`` only for Python 3.4 so newer Python versions can still receive colorama updates.
  53. pytest 4.6.7 (2019-12-05)
  54. =========================
  55. Bug Fixes
  56. ---------
  57. - `#5477 <https://github.com/pytest-dev/pytest/issues/5477>`_: The XML file produced by ``--junitxml`` now correctly contain a ``<testsuites>`` root element.
  58. - `#6044 <https://github.com/pytest-dev/pytest/issues/6044>`_: Properly ignore ``FileNotFoundError`` (``OSError.errno == NOENT`` in Python 2) exceptions when trying to remove old temporary directories,
  59. for instance when multiple processes try to remove the same directory (common with ``pytest-xdist``
  60. for example).
  61. pytest 4.6.6 (2019-10-11)
  62. =========================
  63. Bug Fixes
  64. ---------
  65. - `#5523 <https://github.com/pytest-dev/pytest/issues/5523>`_: Fixed using multiple short options together in the command-line (for example ``-vs``) in Python 3.8+.
  66. - `#5537 <https://github.com/pytest-dev/pytest/issues/5537>`_: Replace ``importlib_metadata`` backport with ``importlib.metadata`` from the
  67. standard library on Python 3.8+.
  68. - `#5806 <https://github.com/pytest-dev/pytest/issues/5806>`_: Fix "lexer" being used when uploading to bpaste.net from ``--pastebin`` to "text".
  69. - `#5902 <https://github.com/pytest-dev/pytest/issues/5902>`_: Fix warnings about deprecated ``cmp`` attribute in ``attrs>=19.2``.
  70. Trivial/Internal Changes
  71. ------------------------
  72. - `#5801 <https://github.com/pytest-dev/pytest/issues/5801>`_: Fixes python version checks (detected by ``flake8-2020``) in case python4 becomes a thing.
  73. pytest 4.6.5 (2019-08-05)
  74. =========================
  75. Bug Fixes
  76. ---------
  77. - `#4344 <https://github.com/pytest-dev/pytest/issues/4344>`_: Fix RuntimeError/StopIteration when trying to collect package with "__init__.py" only.
  78. - `#5478 <https://github.com/pytest-dev/pytest/issues/5478>`_: Fix encode error when using unicode strings in exceptions with ``pytest.raises``.
  79. - `#5524 <https://github.com/pytest-dev/pytest/issues/5524>`_: Fix issue where ``tmp_path`` and ``tmpdir`` would not remove directories containing files marked as read-only,
  80. which could lead to pytest crashing when executed a second time with the ``--basetemp`` option.
  81. - `#5547 <https://github.com/pytest-dev/pytest/issues/5547>`_: ``--step-wise`` now handles ``xfail(strict=True)`` markers properly.
  82. - `#5650 <https://github.com/pytest-dev/pytest/issues/5650>`_: Improved output when parsing an ini configuration file fails.
  83. pytest 4.6.4 (2019-06-28)
  84. =========================
  85. Bug Fixes
  86. ---------
  87. - `#5404 <https://github.com/pytest-dev/pytest/issues/5404>`_: Emit a warning when attempting to unwrap a broken object raises an exception,
  88. for easier debugging (`#5080 <https://github.com/pytest-dev/pytest/issues/5080>`__).
  89. - `#5444 <https://github.com/pytest-dev/pytest/issues/5444>`_: Fix ``--stepwise`` mode when the first file passed on the command-line fails to collect.
  90. - `#5482 <https://github.com/pytest-dev/pytest/issues/5482>`_: Fix bug introduced in 4.6.0 causing collection errors when passing
  91. more than 2 positional arguments to ``pytest.mark.parametrize``.
  92. - `#5505 <https://github.com/pytest-dev/pytest/issues/5505>`_: Fix crash when discovery fails while using ``-p no:terminal``.
  93. pytest 4.6.3 (2019-06-11)
  94. =========================
  95. Bug Fixes
  96. ---------
  97. - `#5383 <https://github.com/pytest-dev/pytest/issues/5383>`_: ``-q`` has again an impact on the style of the collected items
  98. (``--collect-only``) when ``--log-cli-level`` is used.
  99. - `#5389 <https://github.com/pytest-dev/pytest/issues/5389>`_: Fix regressions of `#5063 <https://github.com/pytest-dev/pytest/pull/5063>`__ for ``importlib_metadata.PathDistribution`` which have their ``files`` attribute being ``None``.
  100. - `#5390 <https://github.com/pytest-dev/pytest/issues/5390>`_: Fix regression where the ``obj`` attribute of ``TestCase`` items was no longer bound to methods.
  101. pytest 4.6.2 (2019-06-03)
  102. =========================
  103. Bug Fixes
  104. ---------
  105. - `#5370 <https://github.com/pytest-dev/pytest/issues/5370>`_: Revert unrolling of ``all()`` to fix ``NameError`` on nested comprehensions.
  106. - `#5371 <https://github.com/pytest-dev/pytest/issues/5371>`_: Revert unrolling of ``all()`` to fix incorrect handling of generators with ``if``.
  107. - `#5372 <https://github.com/pytest-dev/pytest/issues/5372>`_: Revert unrolling of ``all()`` to fix incorrect assertion when using ``all()`` in an expression.
  108. pytest 4.6.1 (2019-06-02)
  109. =========================
  110. Bug Fixes
  111. ---------
  112. - `#5354 <https://github.com/pytest-dev/pytest/issues/5354>`_: Fix ``pytest.mark.parametrize`` when the argvalues is an iterator.
  113. - `#5358 <https://github.com/pytest-dev/pytest/issues/5358>`_: Fix assertion rewriting of ``all()`` calls to deal with non-generators.
  114. pytest 4.6.0 (2019-05-31)
  115. =========================
  116. Important
  117. ---------
  118. The ``4.6.X`` series will be the last series to support **Python 2 and Python 3.4**.
  119. For more details, see our `Python 2.7 and 3.4 support plan <https://docs.pytest.org/en/latest/py27-py34-deprecation.html>`__.
  120. Features
  121. --------
  122. - `#4559 <https://github.com/pytest-dev/pytest/issues/4559>`_: Added the ``junit_log_passing_tests`` ini value which can be used to enable or disable logging of passing test output in the Junit XML file.
  123. - `#4956 <https://github.com/pytest-dev/pytest/issues/4956>`_: pytester's ``testdir.spawn`` uses ``tmpdir`` as HOME/USERPROFILE directory.
  124. - `#5062 <https://github.com/pytest-dev/pytest/issues/5062>`_: Unroll calls to ``all`` to full for-loops with assertion rewriting for better failure messages, especially when using Generator Expressions.
  125. - `#5063 <https://github.com/pytest-dev/pytest/issues/5063>`_: Switch from ``pkg_resources`` to ``importlib-metadata`` for entrypoint detection for improved performance and import time.
  126. - `#5091 <https://github.com/pytest-dev/pytest/issues/5091>`_: The output for ini options in ``--help`` has been improved.
  127. - `#5269 <https://github.com/pytest-dev/pytest/issues/5269>`_: ``pytest.importorskip`` includes the ``ImportError`` now in the default ``reason``.
  128. - `#5311 <https://github.com/pytest-dev/pytest/issues/5311>`_: Captured logs that are output for each failing test are formatted using the
  129. ColoredLevelFormatter.
  130. - `#5312 <https://github.com/pytest-dev/pytest/issues/5312>`_: Improved formatting of multiline log messages in Python 3.
  131. Bug Fixes
  132. ---------
  133. - `#2064 <https://github.com/pytest-dev/pytest/issues/2064>`_: The debugging plugin imports the wrapped ``Pdb`` class (``--pdbcls``) on-demand now.
  134. - `#4908 <https://github.com/pytest-dev/pytest/issues/4908>`_: The ``pytest_enter_pdb`` hook gets called with post-mortem (``--pdb``).
  135. - `#5036 <https://github.com/pytest-dev/pytest/issues/5036>`_: Fix issue where fixtures dependent on other parametrized fixtures would be erroneously parametrized.
  136. - `#5256 <https://github.com/pytest-dev/pytest/issues/5256>`_: Handle internal error due to a lone surrogate unicode character not being representable in Jython.
  137. - `#5257 <https://github.com/pytest-dev/pytest/issues/5257>`_: Ensure that ``sys.stdout.mode`` does not include ``'b'`` as it is a text stream.
  138. - `#5278 <https://github.com/pytest-dev/pytest/issues/5278>`_: Pytest's internal python plugin can be disabled using ``-p no:python`` again.
  139. - `#5286 <https://github.com/pytest-dev/pytest/issues/5286>`_: Fix issue with ``disable_test_id_escaping_and_forfeit_all_rights_to_community_support`` option not working when using a list of test IDs in parametrized tests.
  140. - `#5330 <https://github.com/pytest-dev/pytest/issues/5330>`_: Show the test module being collected when emitting ``PytestCollectionWarning`` messages for
  141. test classes with ``__init__`` and ``__new__`` methods to make it easier to pin down the problem.
  142. - `#5333 <https://github.com/pytest-dev/pytest/issues/5333>`_: Fix regression in 4.5.0 with ``--lf`` not re-running all tests with known failures from non-selected tests.
  143. Improved Documentation
  144. ----------------------
  145. - `#5250 <https://github.com/pytest-dev/pytest/issues/5250>`_: Expand docs on use of ``setenv`` and ``delenv`` with ``monkeypatch``.
  146. pytest 4.5.0 (2019-05-11)
  147. =========================
  148. Features
  149. --------
  150. - `#4826 <https://github.com/pytest-dev/pytest/issues/4826>`_: A warning is now emitted when unknown marks are used as a decorator.
  151. This is often due to a typo, which can lead to silently broken tests.
  152. - `#4907 <https://github.com/pytest-dev/pytest/issues/4907>`_: Show XFail reason as part of JUnitXML message field.
  153. - `#5013 <https://github.com/pytest-dev/pytest/issues/5013>`_: Messages from crash reports are displayed within test summaries now, truncated to the terminal width.
  154. - `#5023 <https://github.com/pytest-dev/pytest/issues/5023>`_: New flag ``--strict-markers`` that triggers an error when unknown markers (e.g. those not registered using the `markers option`_ in the configuration file) are used in the test suite.
  155. The existing ``--strict`` option has the same behavior currently, but can be augmented in the future for additional checks.
  156. .. _`markers option`: https://docs.pytest.org/en/latest/reference.html#confval-markers
  157. - `#5026 <https://github.com/pytest-dev/pytest/issues/5026>`_: Assertion failure messages for sequences and dicts contain the number of different items now.
  158. - `#5034 <https://github.com/pytest-dev/pytest/issues/5034>`_: Improve reporting with ``--lf`` and ``--ff`` (run-last-failure).
  159. - `#5035 <https://github.com/pytest-dev/pytest/issues/5035>`_: The ``--cache-show`` option/action accepts an optional glob to show only matching cache entries.
  160. - `#5059 <https://github.com/pytest-dev/pytest/issues/5059>`_: Standard input (stdin) can be given to pytester's ``Testdir.run()`` and ``Testdir.popen()``.
  161. - `#5068 <https://github.com/pytest-dev/pytest/issues/5068>`_: The ``-r`` option learnt about ``A`` to display all reports (including passed ones) in the short test summary.
  162. - `#5108 <https://github.com/pytest-dev/pytest/issues/5108>`_: The short test summary is displayed after passes with output (``-rP``).
  163. - `#5172 <https://github.com/pytest-dev/pytest/issues/5172>`_: The ``--last-failed`` (``--lf``) option got smarter and will now skip entire files if all tests
  164. of that test file have passed in previous runs, greatly speeding up collection.
  165. - `#5177 <https://github.com/pytest-dev/pytest/issues/5177>`_: Introduce new specific warning ``PytestWarning`` subclasses to make it easier to filter warnings based on the class, rather than on the message. The new subclasses are:
  166. * ``PytestAssertRewriteWarning``
  167. * ``PytestCacheWarning``
  168. * ``PytestCollectionWarning``
  169. * ``PytestConfigWarning``
  170. * ``PytestUnhandledCoroutineWarning``
  171. * ``PytestUnknownMarkWarning``
  172. - `#5202 <https://github.com/pytest-dev/pytest/issues/5202>`_: New ``record_testsuite_property`` session-scoped fixture allows users to log ``<property>`` tags at the ``testsuite``
  173. level with the ``junitxml`` plugin.
  174. The generated XML is compatible with the latest xunit standard, contrary to
  175. the properties recorded by ``record_property`` and ``record_xml_attribute``.
  176. - `#5214 <https://github.com/pytest-dev/pytest/issues/5214>`_: The default logging format has been changed to improve readability. Here is an
  177. example of a previous logging message::
  178. test_log_cli_enabled_disabled.py 3 CRITICAL critical message logged by test
  179. This has now become::
  180. CRITICAL root:test_log_cli_enabled_disabled.py:3 critical message logged by test
  181. The formatting can be changed through the `log_format <https://docs.pytest.org/en/latest/reference.html#confval-log_format>`__ configuration option.
  182. - `#5220 <https://github.com/pytest-dev/pytest/issues/5220>`_: ``--fixtures`` now also shows fixture scope for scopes other than ``"function"``.
  183. Bug Fixes
  184. ---------
  185. - `#5113 <https://github.com/pytest-dev/pytest/issues/5113>`_: Deselected items from plugins using ``pytest_collect_modifyitems`` as a hookwrapper are correctly reported now.
  186. - `#5144 <https://github.com/pytest-dev/pytest/issues/5144>`_: With usage errors ``exitstatus`` is set to ``EXIT_USAGEERROR`` in the ``pytest_sessionfinish`` hook now as expected.
  187. - `#5235 <https://github.com/pytest-dev/pytest/issues/5235>`_: ``outcome.exit`` is not used with ``EOF`` in the pdb wrapper anymore, but only with ``quit``.
  188. Improved Documentation
  189. ----------------------
  190. - `#4935 <https://github.com/pytest-dev/pytest/issues/4935>`_: Expand docs on registering marks and the effect of ``--strict``.
  191. Trivial/Internal Changes
  192. ------------------------
  193. - `#4942 <https://github.com/pytest-dev/pytest/issues/4942>`_: ``logging.raiseExceptions`` is not set to ``False`` anymore.
  194. - `#5013 <https://github.com/pytest-dev/pytest/issues/5013>`_: pytest now depends on `wcwidth <https://pypi.org/project/wcwidth>`__ to properly track unicode character sizes for more precise terminal output.
  195. - `#5059 <https://github.com/pytest-dev/pytest/issues/5059>`_: pytester's ``Testdir.popen()`` uses ``stdout`` and ``stderr`` via keyword arguments with defaults now (``subprocess.PIPE``).
  196. - `#5069 <https://github.com/pytest-dev/pytest/issues/5069>`_: The code for the short test summary in the terminal was moved to the terminal plugin.
  197. - `#5082 <https://github.com/pytest-dev/pytest/issues/5082>`_: Improved validation of kwargs for various methods in the pytester plugin.
  198. - `#5202 <https://github.com/pytest-dev/pytest/issues/5202>`_: ``record_property`` now emits a ``PytestWarning`` when used with ``junit_family=xunit2``: the fixture generates
  199. ``property`` tags as children of ``testcase``, which is not permitted according to the most
  200. `recent schema <https://github.com/jenkinsci/xunit-plugin/blob/master/
  201. src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd>`__.
  202. - `#5239 <https://github.com/pytest-dev/pytest/issues/5239>`_: Pin ``pluggy`` to ``< 1.0`` so we don't update to ``1.0`` automatically when
  203. it gets released: there are planned breaking changes, and we want to ensure
  204. pytest properly supports ``pluggy 1.0``.
  205. pytest 4.4.2 (2019-05-08)
  206. =========================
  207. Bug Fixes
  208. ---------
  209. - `#5089 <https://github.com/pytest-dev/pytest/issues/5089>`_: Fix crash caused by error in ``__repr__`` function with both ``showlocals`` and verbose output enabled.
  210. - `#5139 <https://github.com/pytest-dev/pytest/issues/5139>`_: Eliminate core dependency on 'terminal' plugin.
  211. - `#5229 <https://github.com/pytest-dev/pytest/issues/5229>`_: Require ``pluggy>=0.11.0`` which reverts a dependency to ``importlib-metadata`` added in ``0.10.0``.
  212. The ``importlib-metadata`` package cannot be imported when installed as an egg and causes issues when relying on ``setup.py`` to install test dependencies.
  213. Improved Documentation
  214. ----------------------
  215. - `#5171 <https://github.com/pytest-dev/pytest/issues/5171>`_: Doc: ``pytest_ignore_collect``, ``pytest_collect_directory``, ``pytest_collect_file`` and ``pytest_pycollect_makemodule`` hooks's 'path' parameter documented type is now ``py.path.local``
  216. - `#5188 <https://github.com/pytest-dev/pytest/issues/5188>`_: Improve help for ``--runxfail`` flag.
  217. Trivial/Internal Changes
  218. ------------------------
  219. - `#5182 <https://github.com/pytest-dev/pytest/issues/5182>`_: Removed internal and unused ``_pytest.deprecated.MARK_INFO_ATTRIBUTE``.
  220. pytest 4.4.1 (2019-04-15)
  221. =========================
  222. Bug Fixes
  223. ---------
  224. - `#5031 <https://github.com/pytest-dev/pytest/issues/5031>`_: Environment variables are properly restored when using pytester's ``testdir`` fixture.
  225. - `#5039 <https://github.com/pytest-dev/pytest/issues/5039>`_: Fix regression with ``--pdbcls``, which stopped working with local modules in 4.0.0.
  226. - `#5092 <https://github.com/pytest-dev/pytest/issues/5092>`_: Produce a warning when unknown keywords are passed to ``pytest.param(...)``.
  227. - `#5098 <https://github.com/pytest-dev/pytest/issues/5098>`_: Invalidate import caches with ``monkeypatch.syspath_prepend``, which is required with namespace packages being used.
  228. pytest 4.4.0 (2019-03-29)
  229. =========================
  230. Features
  231. --------
  232. - `#2224 <https://github.com/pytest-dev/pytest/issues/2224>`_: ``async`` test functions are skipped and a warning is emitted when a suitable
  233. async plugin is not installed (such as ``pytest-asyncio`` or ``pytest-trio``).
  234. Previously ``async`` functions would not execute at all but still be marked as "passed".
  235. - `#2482 <https://github.com/pytest-dev/pytest/issues/2482>`_: Include new ``disable_test_id_escaping_and_forfeit_all_rights_to_community_support`` option to disable ascii-escaping in parametrized values. This may cause a series of problems and as the name makes clear, use at your own risk.
  236. - `#4718 <https://github.com/pytest-dev/pytest/issues/4718>`_: The ``-p`` option can now be used to early-load plugins also by entry-point name, instead of just
  237. by module name.
  238. This makes it possible to early load external plugins like ``pytest-cov`` in the command-line::
  239. pytest -p pytest_cov
  240. - `#4855 <https://github.com/pytest-dev/pytest/issues/4855>`_: The ``--pdbcls`` option handles classes via module attributes now (e.g.
  241. ``pdb:pdb.Pdb`` with `pdb++`_), and its validation was improved.
  242. .. _pdb++: https://pypi.org/project/pdbpp/
  243. - `#4875 <https://github.com/pytest-dev/pytest/issues/4875>`_: The `testpaths <https://docs.pytest.org/en/latest/reference.html#confval-testpaths>`__ configuration option is now displayed next
  244. to the ``rootdir`` and ``inifile`` lines in the pytest header if the option is in effect, i.e., directories or file names were
  245. not explicitly passed in the command line.
  246. Also, ``inifile`` is only displayed if there's a configuration file, instead of an empty ``inifile:`` string.
  247. - `#4911 <https://github.com/pytest-dev/pytest/issues/4911>`_: Doctests can be skipped now dynamically using ``pytest.skip()``.
  248. - `#4920 <https://github.com/pytest-dev/pytest/issues/4920>`_: Internal refactorings have been made in order to make the implementation of the
  249. `pytest-subtests <https://github.com/pytest-dev/pytest-subtests>`__ plugin
  250. possible, which adds unittest sub-test support and a new ``subtests`` fixture as discussed in
  251. `#1367 <https://github.com/pytest-dev/pytest/issues/1367>`__.
  252. For details on the internal refactorings, please see the details on the related PR.
  253. - `#4931 <https://github.com/pytest-dev/pytest/issues/4931>`_: pytester's ``LineMatcher`` asserts that the passed lines are a sequence.
  254. - `#4936 <https://github.com/pytest-dev/pytest/issues/4936>`_: Handle ``-p plug`` after ``-p no:plug``.
  255. This can be used to override a blocked plugin (e.g. in "addopts") from the
  256. command line etc.
  257. - `#4951 <https://github.com/pytest-dev/pytest/issues/4951>`_: Output capturing is handled correctly when only capturing via fixtures (capsys, capfs) with ``pdb.set_trace()``.
  258. - `#4956 <https://github.com/pytest-dev/pytest/issues/4956>`_: ``pytester`` sets ``$HOME`` and ``$USERPROFILE`` to the temporary directory during test runs.
  259. This ensures to not load configuration files from the real user's home directory.
  260. - `#4980 <https://github.com/pytest-dev/pytest/issues/4980>`_: Namespace packages are handled better with ``monkeypatch.syspath_prepend`` and ``testdir.syspathinsert`` (via ``pkg_resources.fixup_namespace_packages``).
  261. - `#4993 <https://github.com/pytest-dev/pytest/issues/4993>`_: The stepwise plugin reports status information now.
  262. - `#5008 <https://github.com/pytest-dev/pytest/issues/5008>`_: If a ``setup.cfg`` file contains ``[tool:pytest]`` and also the no longer supported ``[pytest]`` section, pytest will use ``[tool:pytest]`` ignoring ``[pytest]``. Previously it would unconditionally error out.
  263. This makes it simpler for plugins to support old pytest versions.
  264. Bug Fixes
  265. ---------
  266. - `#1895 <https://github.com/pytest-dev/pytest/issues/1895>`_: Fix bug where fixtures requested dynamically via ``request.getfixturevalue()`` might be teardown
  267. before the requesting fixture.
  268. - `#4851 <https://github.com/pytest-dev/pytest/issues/4851>`_: pytester unsets ``PYTEST_ADDOPTS`` now to not use outer options with ``testdir.runpytest()``.
  269. - `#4903 <https://github.com/pytest-dev/pytest/issues/4903>`_: Use the correct modified time for years after 2038 in rewritten ``.pyc`` files.
  270. - `#4928 <https://github.com/pytest-dev/pytest/issues/4928>`_: Fix line offsets with ``ScopeMismatch`` errors.
  271. - `#4957 <https://github.com/pytest-dev/pytest/issues/4957>`_: ``-p no:plugin`` is handled correctly for default (internal) plugins now, e.g. with ``-p no:capture``.
  272. Previously they were loaded (imported) always, making e.g. the ``capfd`` fixture available.
  273. - `#4968 <https://github.com/pytest-dev/pytest/issues/4968>`_: The pdb ``quit`` command is handled properly when used after the ``debug`` command with `pdb++`_.
  274. .. _pdb++: https://pypi.org/project/pdbpp/
  275. - `#4975 <https://github.com/pytest-dev/pytest/issues/4975>`_: Fix the interpretation of ``-qq`` option where it was being considered as ``-v`` instead.
  276. - `#4978 <https://github.com/pytest-dev/pytest/issues/4978>`_: ``outcomes.Exit`` is not swallowed in ``assertrepr_compare`` anymore.
  277. - `#4988 <https://github.com/pytest-dev/pytest/issues/4988>`_: Close logging's file handler explicitly when the session finishes.
  278. - `#5003 <https://github.com/pytest-dev/pytest/issues/5003>`_: Fix line offset with mark collection error (off by one).
  279. Improved Documentation
  280. ----------------------
  281. - `#4974 <https://github.com/pytest-dev/pytest/issues/4974>`_: Update docs for ``pytest_cmdline_parse`` hook to note availability liminations
  282. Trivial/Internal Changes
  283. ------------------------
  284. - `#4718 <https://github.com/pytest-dev/pytest/issues/4718>`_: ``pluggy>=0.9`` is now required.
  285. - `#4815 <https://github.com/pytest-dev/pytest/issues/4815>`_: ``funcsigs>=1.0`` is now required for Python 2.7.
  286. - `#4829 <https://github.com/pytest-dev/pytest/issues/4829>`_: Some left-over internal code related to ``yield`` tests has been removed.
  287. - `#4890 <https://github.com/pytest-dev/pytest/issues/4890>`_: Remove internally unused ``anypython`` fixture from the pytester plugin.
  288. - `#4912 <https://github.com/pytest-dev/pytest/issues/4912>`_: Remove deprecated Sphinx directive, ``add_description_unit()``,
  289. pin sphinx-removed-in to >= 0.2.0 to support Sphinx 2.0.
  290. - `#4913 <https://github.com/pytest-dev/pytest/issues/4913>`_: Fix pytest tests invocation with custom ``PYTHONPATH``.
  291. - `#4965 <https://github.com/pytest-dev/pytest/issues/4965>`_: New ``pytest_report_to_serializable`` and ``pytest_report_from_serializable`` **experimental** hooks.
  292. These hooks will be used by ``pytest-xdist``, ``pytest-subtests``, and the replacement for
  293. resultlog to serialize and customize reports.
  294. They are experimental, meaning that their details might change or even be removed
  295. completely in future patch releases without warning.
  296. Feedback is welcome from plugin authors and users alike.
  297. - `#4987 <https://github.com/pytest-dev/pytest/issues/4987>`_: ``Collector.repr_failure`` respects the ``--tb`` option, but only defaults to ``short`` now (with ``auto``).
  298. pytest 4.3.1 (2019-03-11)
  299. =========================
  300. Bug Fixes
  301. ---------
  302. - `#4810 <https://github.com/pytest-dev/pytest/issues/4810>`_: Logging messages inside ``pytest_runtest_logreport()`` are now properly captured and displayed.
  303. - `#4861 <https://github.com/pytest-dev/pytest/issues/4861>`_: Improve validation of contents written to captured output so it behaves the same as when capture is disabled.
  304. - `#4898 <https://github.com/pytest-dev/pytest/issues/4898>`_: Fix ``AttributeError: FixtureRequest has no 'confg' attribute`` bug in ``testdir.copy_example``.
  305. Trivial/Internal Changes
  306. ------------------------
  307. - `#4768 <https://github.com/pytest-dev/pytest/issues/4768>`_: Avoid pkg_resources import at the top-level.
  308. pytest 4.3.0 (2019-02-16)
  309. =========================
  310. Deprecations
  311. ------------
  312. - `#4724 <https://github.com/pytest-dev/pytest/issues/4724>`_: ``pytest.warns()`` now emits a warning when it receives unknown keyword arguments.
  313. This will be changed into an error in the future.
  314. Features
  315. --------
  316. - `#2753 <https://github.com/pytest-dev/pytest/issues/2753>`_: Usage errors from argparse are mapped to pytest's ``UsageError``.
  317. - `#3711 <https://github.com/pytest-dev/pytest/issues/3711>`_: Add the ``--ignore-glob`` parameter to exclude test-modules with Unix shell-style wildcards.
  318. Add the ``collect_ignore_glob`` for ``conftest.py`` to exclude test-modules with Unix shell-style wildcards.
  319. - `#4698 <https://github.com/pytest-dev/pytest/issues/4698>`_: The warning about Python 2.7 and 3.4 not being supported in pytest 5.0 has been removed.
  320. In the end it was considered to be more
  321. of a nuisance than actual utility and users of those Python versions shouldn't have problems as ``pip`` will not
  322. install pytest 5.0 on those interpreters.
  323. - `#4707 <https://github.com/pytest-dev/pytest/issues/4707>`_: With the help of new ``set_log_path()`` method there is a way to set ``log_file`` paths from hooks.
  324. Bug Fixes
  325. ---------
  326. - `#4651 <https://github.com/pytest-dev/pytest/issues/4651>`_: ``--help`` and ``--version`` are handled with ``UsageError``.
  327. - `#4782 <https://github.com/pytest-dev/pytest/issues/4782>`_: Fix ``AssertionError`` with collection of broken symlinks with packages.
  328. pytest 4.2.1 (2019-02-12)
  329. =========================
  330. Bug Fixes
  331. ---------
  332. - `#2895 <https://github.com/pytest-dev/pytest/issues/2895>`_: The ``pytest_report_collectionfinish`` hook now is also called with ``--collect-only``.
  333. - `#3899 <https://github.com/pytest-dev/pytest/issues/3899>`_: Do not raise ``UsageError`` when an imported package has a ``pytest_plugins.py`` child module.
  334. - `#4347 <https://github.com/pytest-dev/pytest/issues/4347>`_: Fix output capturing when using pdb++ with recursive debugging.
  335. - `#4592 <https://github.com/pytest-dev/pytest/issues/4592>`_: Fix handling of ``collect_ignore`` via parent ``conftest.py``.
  336. - `#4700 <https://github.com/pytest-dev/pytest/issues/4700>`_: Fix regression where ``setUpClass`` would always be called in subclasses even if all tests
  337. were skipped by a ``unittest.skip()`` decorator applied in the subclass.
  338. - `#4739 <https://github.com/pytest-dev/pytest/issues/4739>`_: Fix ``parametrize(... ids=<function>)`` when the function returns non-strings.
  339. - `#4745 <https://github.com/pytest-dev/pytest/issues/4745>`_: Fix/improve collection of args when passing in ``__init__.py`` and a test file.
  340. - `#4770 <https://github.com/pytest-dev/pytest/issues/4770>`_: ``more_itertools`` is now constrained to <6.0.0 when required for Python 2.7 compatibility.
  341. - `#526 <https://github.com/pytest-dev/pytest/issues/526>`_: Fix "ValueError: Plugin already registered" exceptions when running in build directories that symlink to actual source.
  342. Improved Documentation
  343. ----------------------
  344. - `#3899 <https://github.com/pytest-dev/pytest/issues/3899>`_: Add note to ``plugins.rst`` that ``pytest_plugins`` should not be used as a name for a user module containing plugins.
  345. - `#4324 <https://github.com/pytest-dev/pytest/issues/4324>`_: Document how to use ``raises`` and ``does_not_raise`` to write parametrized tests with conditional raises.
  346. - `#4709 <https://github.com/pytest-dev/pytest/issues/4709>`_: Document how to customize test failure messages when using
  347. ``pytest.warns``.
  348. Trivial/Internal Changes
  349. ------------------------
  350. - `#4741 <https://github.com/pytest-dev/pytest/issues/4741>`_: Some verbosity related attributes of the TerminalReporter plugin are now
  351. read only properties.
  352. pytest 4.2.0 (2019-01-30)
  353. =========================
  354. Features
  355. --------
  356. - `#3094 <https://github.com/pytest-dev/pytest/issues/3094>`_: `Classic xunit-style <https://docs.pytest.org/en/latest/xunit_setup.html>`__ functions and methods
  357. now obey the scope of *autouse* fixtures.
  358. This fixes a number of surprising issues like ``setup_method`` being called before session-scoped
  359. autouse fixtures (see `#517 <https://github.com/pytest-dev/pytest/issues/517>`__ for an example).
  360. - `#4627 <https://github.com/pytest-dev/pytest/issues/4627>`_: Display a message at the end of the test session when running under Python 2.7 and 3.4 that pytest 5.0 will no longer
  361. support those Python versions.
  362. - `#4660 <https://github.com/pytest-dev/pytest/issues/4660>`_: The number of *selected* tests now are also displayed when the ``-k`` or ``-m`` flags are used.
  363. - `#4688 <https://github.com/pytest-dev/pytest/issues/4688>`_: ``pytest_report_teststatus`` hook now can also receive a ``config`` parameter.
  364. - `#4691 <https://github.com/pytest-dev/pytest/issues/4691>`_: ``pytest_terminal_summary`` hook now can also receive a ``config`` parameter.
  365. Bug Fixes
  366. ---------
  367. - `#3547 <https://github.com/pytest-dev/pytest/issues/3547>`_: ``--junitxml`` can emit XML compatible with Jenkins xUnit.
  368. ``junit_family`` INI option accepts ``legacy|xunit1``, which produces old style output, and ``xunit2`` that conforms more strictly to https://github.com/jenkinsci/xunit-plugin/blob/xunit-2.3.2/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
  369. - `#4280 <https://github.com/pytest-dev/pytest/issues/4280>`_: Improve quitting from pdb, especially with ``--trace``.
  370. Using ``q[quit]`` after ``pdb.set_trace()`` will quit pytest also.
  371. - `#4402 <https://github.com/pytest-dev/pytest/issues/4402>`_: Warning summary now groups warnings by message instead of by test id.
  372. This makes the output more compact and better conveys the general idea of how much code is
  373. actually generating warnings, instead of how many tests call that code.
  374. - `#4536 <https://github.com/pytest-dev/pytest/issues/4536>`_: ``monkeypatch.delattr`` handles class descriptors like ``staticmethod``/``classmethod``.
  375. - `#4649 <https://github.com/pytest-dev/pytest/issues/4649>`_: Restore marks being considered keywords for keyword expressions.
  376. - `#4653 <https://github.com/pytest-dev/pytest/issues/4653>`_: ``tmp_path`` fixture and other related ones provides resolved path (a.k.a real path)
  377. - `#4667 <https://github.com/pytest-dev/pytest/issues/4667>`_: ``pytest_terminal_summary`` uses result from ``pytest_report_teststatus`` hook, rather than hardcoded strings.
  378. - `#4669 <https://github.com/pytest-dev/pytest/issues/4669>`_: Correctly handle ``unittest.SkipTest`` exception containing non-ascii characters on Python 2.
  379. - `#4680 <https://github.com/pytest-dev/pytest/issues/4680>`_: Ensure the ``tmpdir`` and the ``tmp_path`` fixtures are the same folder.
  380. - `#4681 <https://github.com/pytest-dev/pytest/issues/4681>`_: Ensure ``tmp_path`` is always a real path.
  381. Trivial/Internal Changes
  382. ------------------------
  383. - `#4643 <https://github.com/pytest-dev/pytest/issues/4643>`_: Use ``a.item()`` instead of the deprecated ``np.asscalar(a)`` in ``pytest.approx``.
  384. ``np.asscalar`` has been `deprecated <https://github.com/numpy/numpy/blob/master/doc/release/1.16.0-notes.rst#new-deprecations>`__ in ``numpy 1.16.``.
  385. - `#4657 <https://github.com/pytest-dev/pytest/issues/4657>`_: Copy saferepr from pylib
  386. - `#4668 <https://github.com/pytest-dev/pytest/issues/4668>`_: The verbose word for expected failures in the teststatus report changes from ``xfail`` to ``XFAIL`` to be consistent with other test outcomes.
  387. pytest 4.1.1 (2019-01-12)
  388. =========================
  389. Bug Fixes
  390. ---------
  391. - `#2256 <https://github.com/pytest-dev/pytest/issues/2256>`_: Show full repr with ``assert a==b`` and ``-vv``.
  392. - `#3456 <https://github.com/pytest-dev/pytest/issues/3456>`_: Extend Doctest-modules to ignore mock objects.
  393. - `#4617 <https://github.com/pytest-dev/pytest/issues/4617>`_: Fixed ``pytest.warns`` bug when context manager is reused (e.g. multiple parametrization).
  394. - `#4631 <https://github.com/pytest-dev/pytest/issues/4631>`_: Don't rewrite assertion when ``__getattr__`` is broken
  395. Improved Documentation
  396. ----------------------
  397. - `#3375 <https://github.com/pytest-dev/pytest/issues/3375>`_: Document that using ``setup.cfg`` may crash other tools or cause hard to track down problems because it uses a different parser than ``pytest.ini`` or ``tox.ini`` files.
  398. Trivial/Internal Changes
  399. ------------------------
  400. - `#4602 <https://github.com/pytest-dev/pytest/issues/4602>`_: Uninstall ``hypothesis`` in regen tox env.
  401. pytest 4.1.0 (2019-01-05)
  402. =========================
  403. Removals
  404. --------
  405. - `#2169 <https://github.com/pytest-dev/pytest/issues/2169>`_: ``pytest.mark.parametrize``: in previous versions, errors raised by id functions were suppressed and changed into warnings. Now the exceptions are propagated, along with a pytest message informing the node, parameter value and index where the exception occurred.
  406. - `#3078 <https://github.com/pytest-dev/pytest/issues/3078>`_: Remove legacy internal warnings system: ``config.warn``, ``Node.warn``. The ``pytest_logwarning`` now issues a warning when implemented.
  407. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#config-warn-and-node-warn>`__ on information on how to update your code.
  408. - `#3079 <https://github.com/pytest-dev/pytest/issues/3079>`_: Removed support for yield tests - they are fundamentally broken because they don't support fixtures properly since collection and test execution were separated.
  409. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#yield-tests>`__ on information on how to update your code.
  410. - `#3082 <https://github.com/pytest-dev/pytest/issues/3082>`_: Removed support for applying marks directly to values in ``@pytest.mark.parametrize``. Use ``pytest.param`` instead.
  411. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#marks-in-pytest-mark-parametrize>`__ on information on how to update your code.
  412. - `#3083 <https://github.com/pytest-dev/pytest/issues/3083>`_: Removed ``Metafunc.addcall``. This was the predecessor mechanism to ``@pytest.mark.parametrize``.
  413. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#metafunc-addcall>`__ on information on how to update your code.
  414. - `#3085 <https://github.com/pytest-dev/pytest/issues/3085>`_: Removed support for passing strings to ``pytest.main``. Now, always pass a list of strings instead.
  415. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#passing-command-line-string-to-pytest-main>`__ on information on how to update your code.
  416. - `#3086 <https://github.com/pytest-dev/pytest/issues/3086>`_: ``[pytest]`` section in **setup.cfg** files is no longer supported, use ``[tool:pytest]`` instead. ``setup.cfg`` files
  417. are meant for use with ``distutils``, and a section named ``pytest`` has notoriously been a source of conflicts and bugs.
  418. Note that for **pytest.ini** and **tox.ini** files the section remains ``[pytest]``.
  419. - `#3616 <https://github.com/pytest-dev/pytest/issues/3616>`_: Removed the deprecated compat properties for ``node.Class/Function/Module`` - use ``pytest.Class/Function/Module`` now.
  420. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#internal-classes-accessed-through-node>`__ on information on how to update your code.
  421. - `#4421 <https://github.com/pytest-dev/pytest/issues/4421>`_: Removed the implementation of the ``pytest_namespace`` hook.
  422. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace>`__ on information on how to update your code.
  423. - `#4489 <https://github.com/pytest-dev/pytest/issues/4489>`_: Removed ``request.cached_setup``. This was the predecessor mechanism to modern fixtures.
  424. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#cached-setup>`__ on information on how to update your code.
  425. - `#4535 <https://github.com/pytest-dev/pytest/issues/4535>`_: Removed the deprecated ``PyCollector.makeitem`` method. This method was made public by mistake a long time ago.
  426. - `#4543 <https://github.com/pytest-dev/pytest/issues/4543>`_: Removed support to define fixtures using the ``pytest_funcarg__`` prefix. Use the ``@pytest.fixture`` decorator instead.
  427. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#pytest-funcarg-prefix>`__ on information on how to update your code.
  428. - `#4545 <https://github.com/pytest-dev/pytest/issues/4545>`_: Calling fixtures directly is now always an error instead of a warning.
  429. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly>`__ on information on how to update your code.
  430. - `#4546 <https://github.com/pytest-dev/pytest/issues/4546>`_: Remove ``Node.get_marker(name)`` the return value was not usable for more than a existence check.
  431. Use ``Node.get_closest_marker(name)`` as a replacement.
  432. - `#4547 <https://github.com/pytest-dev/pytest/issues/4547>`_: The deprecated ``record_xml_property`` fixture has been removed, use the more generic ``record_property`` instead.
  433. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#record-xml-property>`__ for more information.
  434. - `#4548 <https://github.com/pytest-dev/pytest/issues/4548>`_: An error is now raised if the ``pytest_plugins`` variable is defined in a non-top-level ``conftest.py`` file (i.e., not residing in the ``rootdir``).
  435. See our `docs <https://docs.pytest.org/en/latest/deprecations.html#pytest-plugins-in-non-top-level-conftest-files>`__ for more information.
  436. - `#891 <https://github.com/pytest-dev/pytest/issues/891>`_: Remove ``testfunction.markername`` attributes - use ``Node.iter_markers(name=None)`` to iterate them.
  437. Deprecations
  438. ------------
  439. - `#3050 <https://github.com/pytest-dev/pytest/issues/3050>`_: Deprecated the ``pytest.config`` global.
  440. See https://docs.pytest.org/en/latest/deprecations.html#pytest-config-global for rationale.
  441. - `#3974 <https://github.com/pytest-dev/pytest/issues/3974>`_: Passing the ``message`` parameter of ``pytest.raises`` now issues a ``DeprecationWarning``.
  442. It is a common mistake to think this parameter will match the exception message, while in fact
  443. it only serves to provide a custom message in case the ``pytest.raises`` check fails. To avoid this
  444. mistake and because it is believed to be little used, pytest is deprecating it without providing
  445. an alternative for the moment.
  446. If you have concerns about this, please comment on `issue #3974 <https://github.com/pytest-dev/pytest/issues/3974>`__.
  447. - `#4435 <https://github.com/pytest-dev/pytest/issues/4435>`_: Deprecated ``raises(..., 'code(as_a_string)')`` and ``warns(..., 'code(as_a_string)')``.
  448. See https://docs.pytest.org/en/latest/deprecations.html#raises-warns-exec for rationale and examples.
  449. Features
  450. --------
  451. - `#3191 <https://github.com/pytest-dev/pytest/issues/3191>`_: A warning is now issued when assertions are made for ``None``.
  452. This is a common source of confusion among new users, which write:
  453. .. code-block:: python
  454. assert mocked_object.assert_called_with(3, 4, 5, key="value")
  455. When they should write:
  456. .. code-block:: python
  457. mocked_object.assert_called_with(3, 4, 5, key="value")
  458. Because the ``assert_called_with`` method of mock objects already executes an assertion.
  459. This warning will not be issued when ``None`` is explicitly checked. An assertion like:
  460. .. code-block:: python
  461. assert variable is None
  462. will not issue the warning.
  463. - `#3632 <https://github.com/pytest-dev/pytest/issues/3632>`_: Richer equality comparison introspection on ``AssertionError`` for objects created using `attrs <http://www.attrs.org/en/stable/>`__ or `dataclasses <https://docs.python.org/3/library/dataclasses.html>`_ (Python 3.7+, `backported to 3.6 <https://pypi.org/project/dataclasses>`__).
  464. - `#4278 <https://github.com/pytest-dev/pytest/issues/4278>`_: ``CACHEDIR.TAG`` files are now created inside cache directories.
  465. Those files are part of the `Cache Directory Tagging Standard <http://www.bford.info/cachedir/spec.html>`__, and can
  466. be used by backup or synchronization programs to identify pytest's cache directory as such.
  467. - `#4292 <https://github.com/pytest-dev/pytest/issues/4292>`_: ``pytest.outcomes.Exit`` is derived from ``SystemExit`` instead of ``KeyboardInterrupt``. This allows us to better handle ``pdb`` exiting.
  468. - `#4371 <https://github.com/pytest-dev/pytest/issues/4371>`_: Updated the ``--collect-only`` option to display test descriptions when ran using ``--verbose``.
  469. - `#4386 <https://github.com/pytest-dev/pytest/issues/4386>`_: Restructured ``ExceptionInfo`` object construction and ensure incomplete instances have a ``repr``/``str``.
  470. - `#4416 <https://github.com/pytest-dev/pytest/issues/4416>`_: pdb: added support for keyword arguments with ``pdb.set_trace``.
  471. It handles ``header`` similar to Python 3.7 does it, and forwards any
  472. other keyword arguments to the ``Pdb`` constructor.
  473. This allows for ``__import__("pdb").set_trace(skip=["foo.*"])``.
  474. - `#4483 <https://github.com/pytest-dev/pytest/issues/4483>`_: Added ini parameter ``junit_duration_report`` to optionally report test call durations, excluding setup and teardown times.
  475. The JUnit XML specification and the default pytest behavior is to include setup and teardown times in the test duration
  476. report. You can include just the call durations instead (excluding setup and teardown) by adding this to your ``pytest.ini`` file:
  477. .. code-block:: ini
  478. [pytest]
  479. junit_duration_report = call
  480. - `#4532 <https://github.com/pytest-dev/pytest/issues/4532>`_: ``-ra`` now will show errors and failures last, instead of as the first items in the summary.
  481. This makes it easier to obtain a list of errors and failures to run tests selectively.
  482. - `#4599 <https://github.com/pytest-dev/pytest/issues/4599>`_: ``pytest.importorskip`` now supports a ``reason`` parameter, which will be shown when the
  483. requested module cannot be imported.
  484. Bug Fixes
  485. ---------
  486. - `#3532 <https://github.com/pytest-dev/pytest/issues/3532>`_: ``-p`` now accepts its argument without a space between the value, for example ``-pmyplugin``.
  487. - `#4327 <https://github.com/pytest-dev/pytest/issues/4327>`_: ``approx`` again works with more generic containers, more precisely instances of ``Iterable`` and ``Sized`` instead of more restrictive ``Sequence``.
  488. - `#4397 <https://github.com/pytest-dev/pytest/issues/4397>`_: Ensure that node ids are printable.
  489. - `#4435 <https://github.com/pytest-dev/pytest/issues/4435>`_: Fixed ``raises(..., 'code(string)')`` frame filename.
  490. - `#4458 <https://github.com/pytest-dev/pytest/issues/4458>`_: Display actual test ids in ``--collect-only``.
  491. Improved Documentation
  492. ----------------------
  493. - `#4557 <https://github.com/pytest-dev/pytest/issues/4557>`_: Markers example documentation page updated to support latest pytest version.
  494. - `#4558 <https://github.com/pytest-dev/pytest/issues/4558>`_: Update cache documentation example to correctly show cache hit and miss.
  495. - `#4580 <https://github.com/pytest-dev/pytest/issues/4580>`_: Improved detailed summary report documentation.
  496. Trivial/Internal Changes
  497. ------------------------
  498. - `#4447 <https://github.com/pytest-dev/pytest/issues/4447>`_: Changed the deprecation type of ``--result-log`` to ``PytestDeprecationWarning``.
  499. It was decided to remove this feature at the next major revision.
  500. pytest 4.0.2 (2018-12-13)
  501. =========================
  502. Bug Fixes
  503. ---------
  504. - `#4265 <https://github.com/pytest-dev/pytest/issues/4265>`_: Validate arguments from the ``PYTEST_ADDOPTS`` environment variable and the ``addopts`` ini option separately.
  505. - `#4435 <https://github.com/pytest-dev/pytest/issues/4435>`_: Fix ``raises(..., 'code(string)')`` frame filename.
  506. - `#4500 <https://github.com/pytest-dev/pytest/issues/4500>`_: When a fixture yields and a log call is made after the test runs, and, if the test is interrupted, capture attributes are ``None``.
  507. - `#4538 <https://github.com/pytest-dev/pytest/issues/4538>`_: Raise ``TypeError`` for ``with raises(..., match=<non-None falsey value>)``.
  508. Improved Documentation
  509. ----------------------
  510. - `#1495 <https://github.com/pytest-dev/pytest/issues/1495>`_: Document common doctest fixture directory tree structure pitfalls
  511. pytest 4.0.1 (2018-11-23)
  512. =========================
  513. Bug Fixes
  514. ---------
  515. - `#3952 <https://github.com/pytest-dev/pytest/issues/3952>`_: Display warnings before "short test summary info" again, but still later warnings in the end.
  516. - `#4386 <https://github.com/pytest-dev/pytest/issues/4386>`_: Handle uninitialized exceptioninfo in repr/str.
  517. - `#4393 <https://github.com/pytest-dev/pytest/issues/4393>`_: Do not create ``.gitignore``/``README.md`` files in existing cache directories.
  518. - `#4400 <https://github.com/pytest-dev/pytest/issues/4400>`_: Rearrange warning handling for the yield test errors so the opt-out in 4.0.x correctly works.
  519. - `#4405 <https://github.com/pytest-dev/pytest/issues/4405>`_: Fix collection of testpaths with ``--pyargs``.
  520. - `#4412 <https://github.com/pytest-dev/pytest/issues/4412>`_: Fix assertion rewriting involving ``Starred`` + side-effects.
  521. - `#4425 <https://github.com/pytest-dev/pytest/issues/4425>`_: Ensure we resolve the absolute path when the given ``--basetemp`` is a relative path.
  522. Trivial/Internal Changes
  523. ------------------------
  524. - `#4315 <https://github.com/pytest-dev/pytest/issues/4315>`_: Use ``pkg_resources.parse_version`` instead of ``LooseVersion`` in minversion check.
  525. - `#4440 <https://github.com/pytest-dev/pytest/issues/4440>`_: Adjust the stack level of some internal pytest warnings.
  526. pytest 4.0.0 (2018-11-13)
  527. =========================
  528. Removals
  529. --------
  530. - `#3737 <https://github.com/pytest-dev/pytest/issues/3737>`_: **RemovedInPytest4Warnings are now errors by default.**
  531. Following our plan to remove deprecated features with as little disruption as
  532. possible, all warnings of type ``RemovedInPytest4Warnings`` now generate errors
  533. instead of warning messages.
  534. **The affected features will be effectively removed in pytest 4.1**, so please consult the
  535. `Deprecations and Removals <https://docs.pytest.org/en/latest/deprecations.html>`__
  536. section in the docs for directions on how to update existing code.
  537. In the pytest ``4.0.X`` series, it is possible to change the errors back into warnings as a stop
  538. gap measure by adding this to your ``pytest.ini`` file:
  539. .. code-block:: ini
  540. [pytest]
  541. filterwarnings =
  542. ignore::pytest.RemovedInPytest4Warning
  543. But this will stop working when pytest ``4.1`` is released.
  544. **If you have concerns** about the removal of a specific feature, please add a
  545. comment to `#4348 <https://github.com/pytest-dev/pytest/issues/4348>`__.
  546. - `#4358 <https://github.com/pytest-dev/pytest/issues/4358>`_: Remove the ``::()`` notation to denote a test class instance in node ids.
  547. Previously, node ids that contain test instances would use ``::()`` to denote the instance like this::
  548. test_foo.py::Test::()::test_bar
  549. The extra ``::()`` was puzzling to most users and has been removed, so that the test id becomes now::
  550. test_foo.py::Test::test_bar
  551. This change could not accompany a deprecation period as is usual when user-facing functionality changes because
  552. it was not really possible to detect when the functionality was being used explicitly.
  553. The extra ``::()`` might have been removed in some places internally already,
  554. which then led to confusion in places where it was expected, e.g. with
  555. ``--deselect`` (`#4127 <https://github.com/pytest-dev/pytest/issues/4127>`_).
  556. Test class instances are also not listed with ``--collect-only`` anymore.
  557. Features
  558. --------
  559. - `#4270 <https://github.com/pytest-dev/pytest/issues/4270>`_: The ``cache_dir`` option uses ``$TOX_ENV_DIR`` as prefix (if set in the environment).
  560. This uses a different cache per tox environment by default.
  561. Bug Fixes
  562. ---------
  563. - `#3554 <https://github.com/pytest-dev/pytest/issues/3554>`_: Fix ``CallInfo.__repr__`` for when the call is not finished yet.
  564. pytest 3.10.1 (2018-11-11)
  565. ==========================
  566. Bug Fixes
  567. ---------
  568. - `#4287 <https://github.com/pytest-dev/pytest/issues/4287>`_: Fix nested usage of debugging plugin (pdb), e.g. with pytester's ``testdir.runpytest``.
  569. - `#4304 <https://github.com/pytest-dev/pytest/issues/4304>`_: Block the ``stepwise`` plugin if ``cacheprovider`` is also blocked, as one depends on the other.
  570. - `#4306 <https://github.com/pytest-dev/pytest/issues/4306>`_: Parse ``minversion`` as an actual version and not as dot-separated strings.
  571. - `#4310 <https://github.com/pytest-dev/pytest/issues/4310>`_: Fix duplicate collection due to multiple args matching the same packages.
  572. - `#4321 <https://github.com/pytest-dev/pytest/issues/4321>`_: Fix ``item.nodeid`` with resolved symlinks.
  573. - `#4325 <https://github.com/pytest-dev/pytest/issues/4325>`_: Fix collection of direct symlinked files, where the target does not match ``python_files``.
  574. - `#4329 <https://github.com/pytest-dev/pytest/issues/4329>`_: Fix TypeError in report_collect with _collect_report_last_write.
  575. Trivial/Internal Changes
  576. ------------------------
  577. - `#4305 <https://github.com/pytest-dev/pytest/issues/4305>`_: Replace byte/unicode helpers in test_capture with python level syntax.
  578. pytest 3.10.0 (2018-11-03)
  579. ==========================
  580. Features
  581. --------
  582. - `#2619 <https://github.com/pytest-dev/pytest/issues/2619>`_: Resume capturing output after ``continue`` with ``__import__("pdb").set_trace()``.
  583. This also adds a new ``pytest_leave_pdb`` hook, and passes in ``pdb`` to the
  584. existing ``pytest_enter_pdb`` hook.
  585. - `#4147 <https://github.com/pytest-dev/pytest/issues/4147>`_: Add ``--sw``, ``--stepwise`` as an alternative to ``--lf -x`` for stopping at the first failure, but starting the next test invocation from that test. See `the documentation <https://docs.pytest.org/en/latest/cache.html#stepwise>`__ for more info.
  586. - `#4188 <https://github.com/pytest-dev/pytest/issues/4188>`_: Make ``--color`` emit colorful dots when not running in verbose mode. Earlier, it would only colorize the test-by-test output if ``--verbose`` was also passed.
  587. - `#4225 <https://github.com/pytest-dev/pytest/issues/4225>`_: Improve performance with collection reporting in non-quiet mode with terminals.
  588. The "collecting …" message is only printed/updated every 0.5s.
  589. Bug Fixes
  590. ---------
  591. - `#2701 <https://github.com/pytest-dev/pytest/issues/2701>`_: Fix false ``RemovedInPytest4Warning: usage of Session... is deprecated, please use pytest`` warnings.
  592. - `#4046 <https://github.com/pytest-dev/pytest/issues/4046>`_: Fix problems with running tests in package ``__init__.py`` files.
  593. - `#4260 <https://github.com/pytest-dev/pytest/issues/4260>`_: Swallow warnings during anonymous compilation of source.
  594. - `#4262 <https://github.com/pytest-dev/pytest/issues/4262>`_: Fix access denied error when deleting stale directories created by ``tmpdir`` / ``tmp_path``.
  595. - `#611 <https://github.com/pytest-dev/pytest/issues/611>`_: Naming a fixture ``request`` will now raise a warning: the ``request`` fixture is internal and
  596. should not be overwritten as it will lead to internal errors.
  597. - `#4266 <https://github.com/pytest-dev/pytest/issues/4266>`_: Handle (ignore) exceptions raised during collection, e.g. with Django's LazySettings proxy class.
  598. Improved Documentation
  599. ----------------------
  600. - `#4255 <https://github.com/pytest-dev/pytest/issues/4255>`_: Added missing documentation about the fact that module names passed to filter warnings are not regex-escaped.
  601. Trivial/Internal Changes
  602. ------------------------
  603. - `#4272 <https://github.com/pytest-dev/pytest/issues/4272>`_: Display cachedir also in non-verbose mode if non-default.
  604. - `#4277 <https://github.com/pytest-dev/pytest/issues/4277>`_: pdb: improve message about output capturing with ``set_trace``.
  605. Do not display "IO-capturing turned off/on" when ``-s`` is used to avoid
  606. confusion.
  607. - `#4279 <https://github.com/pytest-dev/pytest/issues/4279>`_: Improve message and stack level of warnings issued by ``monkeypatch.setenv`` when the value of the environment variable is not a ``str``.
  608. pytest 3.9.3 (2018-10-27)
  609. =========================
  610. Bug Fixes
  611. ---------
  612. - `#4174 <https://github.com/pytest-dev/pytest/issues/4174>`_: Fix "ValueError: Plugin already registered" with conftest plugins via symlink.
  613. - `#4181 <https://github.com/pytest-dev/pytest/issues/4181>`_: Handle race condition between creation and deletion of temporary folders.
  614. - `#4221 <https://github.com/pytest-dev/pytest/issues/4221>`_: Fix bug where the warning summary at the end of the test session was not showing the test where the warning was originated.
  615. - `#4243 <https://github.com/pytest-dev/pytest/issues/4243>`_: Fix regression when ``stacklevel`` for warnings was passed as positional argument on python2.
  616. Improved Documentation
  617. ----------------------
  618. - `#3851 <https://github.com/pytest-dev/pytest/issues/3851>`_: Add reference to ``empty_parameter_set_mark`` ini option in documentation of ``@pytest.mark.parametrize``
  619. Trivial/Internal Changes
  620. ------------------------
  621. - `#4028 <https://github.com/pytest-dev/pytest/issues/4028>`_: Revert patching of ``sys.breakpointhook`` since it appears to do nothing.
  622. - `#4233 <https://github.com/pytest-dev/pytest/issues/4233>`_: Apply an import sorter (``reorder-python-imports``) to the codebase.
  623. - `#4248 <https://github.com/pytest-dev/pytest/issues/4248>`_: Remove use of unnecessary compat shim, six.binary_type
  624. pytest 3.9.2 (2018-10-22)
  625. =========================
  626. Bug Fixes
  627. ---------
  628. - `#2909 <https://github.com/pytest-dev/pytest/issues/2909>`_: Improve error message when a recursive dependency between fixtures is detected.
  629. - `#3340 <https://github.com/pytest-dev/pytest/issues/3340>`_: Fix logging messages not shown in hooks ``pytest_sessionstart()`` and ``pytest_sessionfinish()``.
  630. - `#3533 <https://github.com/pytest-dev/pytest/issues/3533>`_: Fix unescaped XML raw objects in JUnit report for skipped tests
  631. - `#3691 <https://github.com/pytest-dev/pytest/issues/3691>`_: Python 2: safely format warning message about passing unicode strings to ``warnings.warn``, which may cause
  632. surprising ``MemoryError`` exception when monkey patching ``warnings.warn`` itself.
  633. - `#4026 <https://github.com/pytest-dev/pytest/issues/4026>`_: Improve error message when it is not possible to determine a function's signature.
  634. - `#4177 <https://github.com/pytest-dev/pytest/issues/4177>`_: Pin ``setuptools>=40.0`` to support ``py_modules`` in ``setup.cfg``
  635. - `#4179 <https://github.com/pytest-dev/pytest/issues/4179>`_: Restore the tmpdir behaviour of symlinking the current test run.
  636. - `#4192 <https://github.com/pytest-dev/pytest/issues/4192>`_: Fix filename reported by ``warnings.warn`` when using ``recwarn`` under python2.
  637. pytest 3.9.1 (2018-10-16)
  638. =========================
  639. Features
  640. --------
  641. - `#4159 <https://github.com/pytest-dev/pytest/issues/4159>`_: For test-suites containing test classes, the information about the subclassed
  642. module is now output only if a higher verbosity level is specified (at least
  643. "-vv").
  644. pytest 3.9.0 (2018-10-15 - not published due to a release automation bug)
  645. =========================================================================
  646. Deprecations
  647. ------------
  648. - `#3616 <https://github.com/pytest-dev/pytest/issues/3616>`_: The following accesses have been documented as deprecated for years, but are now actually emitting deprecation warnings.
  649. * Access of ``Module``, ``Function``, ``Class``, ``Instance``, ``File`` and ``Item`` through ``Node`` instances. Now
  650. users will this warning::
  651. usage of Function.Module is deprecated, please use pytest.Module instead
  652. Users should just ``import pytest`` and access those objects using the ``pytest`` module.
  653. * ``request.cached_setup``, this was the precursor of the setup/teardown mechanism available to fixtures. You can
  654. consult `funcarg comparison section in the docs <https://docs.pytest.org/en/latest/funcarg_compare.html>`_.
  655. * Using objects named ``"Class"`` as a way to customize the type of nodes that are collected in ``Collector``
  656. subclasses has been deprecated. Users instead should use ``pytest_collect_make_item`` to customize node types during
  657. collection.
  658. This issue should affect only advanced plugins who create new collection types, so if you see this warning
  659. message please contact the authors so they can change the code.
  660. * The warning that produces the message below has changed to ``RemovedInPytest4Warning``::
  661. getfuncargvalue is deprecated, use getfixturevalue
  662. - `#3988 <https://github.com/pytest-dev/pytest/issues/3988>`_: Add a Deprecation warning for pytest.ensuretemp as it was deprecated since a while.
  663. Features
  664. --------
  665. - `#2293 <https://github.com/pytest-dev/pytest/issues/2293>`_: Improve usage errors messages by hiding internal details which can be distracting and noisy.
  666. This has the side effect that some error conditions that previously raised generic errors (such as
  667. ``ValueError`` for unregistered marks) are now raising ``Failed`` exceptions.
  668. - `#3332 <https://github.com/pytest-dev/pytest/issues/3332>`_: Improve the error displayed when a ``conftest.py`` file could not be imported.
  669. In order to implement this, a new ``chain`` parameter was added to ``ExceptionInfo.getrepr``
  670. to show or hide chained tracebacks in Python 3 (defaults to ``True``).
  671. - `#3849 <https://github.com/pytest-dev/pytest/issues/3849>`_: Add ``empty_parameter_set_mark=fail_at_collect`` ini option for raising an exception when parametrize collects an empty set.
  672. - `#3964 <https://github.com/pytest-dev/pytest/issues/3964>`_: Log messages generated in the collection phase are shown when
  673. live-logging is enabled and/or when they are logged to a file.
  674. - `#3985 <https://github.com/pytest-dev/pytest/issues/3985>`_: Introduce ``tmp_path`` as a fixture providing a Path object.
  675. - `#4013 <https://github.com/pytest-dev/pytest/issues/4013>`_: Deprecation warnings are now shown even if you customize the warnings filters yourself. In the previous version
  676. any customization would override pytest's filters and deprecation warnings would fall back to being hidden by default.
  677. - `#4073 <https://github.com/pytest-dev/pytest/issues/4073>`_: Allow specification of timeout for ``Testdir.runpytest_subprocess()`` and ``Testdir.run()``.
  678. - `#4098 <https://github.com/pytest-dev/pytest/issues/4098>`_: Add returncode argument to pytest.exit() to exit pytest with a specific return code.
  679. - `#4102 <https://github.com/pytest-dev/pytest/issues/4102>`_: Reimplement ``pytest.deprecated_call`` using ``pytest.warns`` so it supports the ``match='...'`` keyword argument.
  680. This has the side effect that ``pytest.deprecated_call`` now raises ``pytest.fail.Exception`` instead
  681. of ``AssertionError``.
  682. - `#4149 <https://github.com/pytest-dev/pytest/issues/4149>`_: Require setuptools>=30.3 and move most of the metadata to ``setup.cfg``.
  683. Bug Fixes
  684. ---------
  685. - `#2535 <https://github.com/pytest-dev/pytest/issues/2535>`_: Improve error message when test functions of ``unittest.TestCase`` subclasses use a parametrized fixture.
  686. - `#3057 <https://github.com/pytest-dev/pytest/issues/3057>`_: ``request.fixturenames`` now correctly returns the name of fixtures created by ``request.getfixturevalue()``.
  687. - `#3946 <https://github.com/pytest-dev/pytest/issues/3946>`_: Warning filters passed as command line options using ``-W`` now take precedence over filters defined in ``ini``
  688. configuration files.
  689. - `#4066 <https://github.com/pytest-dev/pytest/issues/4066>`_: Fix source reindenting by using ``textwrap.dedent`` directly.
  690. - `#4102 <https://github.com/pytest-dev/pytest/issues/4102>`_: ``pytest.warn`` will capture previously-warned warnings in Python 2. Previously they were never raised.
  691. - `#4108 <https://github.com/pytest-dev/pytest/issues/4108>`_: Resolve symbolic links for args.
  692. This fixes running ``pytest tests/test_foo.py::test_bar``, where ``tests``
  693. is a symlink to ``project/app/tests``:
  694. previously ``project/app/conftest.py`` would be ignored for fixtures then.
  695. - `#4132 <https://github.com/pytest-dev/pytest/issues/4132>`_: Fix duplicate printing of internal errors when using ``--pdb``.
  696. - `#4135 <https://github.com/pytest-dev/pytest/issues/4135>`_: pathlib based tmpdir cleanup now correctly handles symlinks in the folder.
  697. - `#4152 <https://github.com/pytest-dev/pytest/issues/4152>`_: Display the filename when encountering ``SyntaxWarning``.
  698. Improved Documentation
  699. ----------------------
  700. - `#3713 <https://github.com/pytest-dev/pytest/issues/3713>`_: Update usefixtures documentation to clarify that it can't be used with fixture functions.
  701. - `#4058 <https://github.com/pytest-dev/pytest/issues/4058>`_: Update fixture documentation to specify that a fixture can be invoked twice in the scope it's defined for.
  702. - `#4064 <https://github.com/pytest-dev/pytest/issues/4064>`_: According to unittest.rst, setUpModule and tearDownModule were not implemented, but it turns out they are. So updated the documentation for unittest.
  703. - `#4151 <https://github.com/pytest-dev/pytest/issues/4151>`_: Add tempir testing example to CONTRIBUTING.rst guide
  704. Trivial/Internal Changes
  705. ------------------------
  706. - `#2293 <https://github.com/pytest-dev/pytest/issues/2293>`_: The internal ``MarkerError`` exception has been removed.
  707. - `#3988 <https://github.com/pytest-dev/pytest/issues/3988>`_: Port the implementation of tmpdir to pathlib.
  708. - `#4063 <https://github.com/pytest-dev/pytest/issues/4063>`_: Exclude 0.00 second entries from ``--duration`` output unless ``-vv`` is passed on the command-line.
  709. - `#4093 <https://github.com/pytest-dev/pytest/issues/4093>`_: Fixed formatting of string literals in internal tests.
  710. pytest 3.8.2 (2018-10-02)
  711. =========================
  712. Deprecations and Removals
  713. -------------------------
  714. - `#4036 <https://github.com/pytest-dev/pytest/issues/4036>`_: The ``item`` parameter of ``pytest_warning_captured`` hook is now documented as deprecated. We realized only after
  715. the ``3.8`` release that this parameter is incompatible with ``pytest-xdist``.
  716. Our policy is to not deprecate features during bugfix releases, but in this case we believe it makes sense as we are
  717. only documenting it as deprecated, without issuing warnings which might potentially break test suites. This will get
  718. the word out that hook implementers should not use this parameter at all.
  719. In a future release ``item`` will always be ``None`` and will emit a proper warning when a hook implementation
  720. makes use of it.
  721. Bug Fixes
  722. ---------
  723. - `#3539 <https://github.com/pytest-dev/pytest/issues/3539>`_: Fix reload on assertion rewritten modules.
  724. - `#4034 <https://github.com/pytest-dev/pytest/issues/4034>`_: The ``.user_properties`` attribute of ``TestReport`` objects is a list
  725. of (name, value) tuples, but could sometimes be instantiated as a tuple
  726. of tuples. It is now always a list.
  727. - `#4039 <https://github.com/pytest-dev/pytest/issues/4039>`_: No longer issue warnings about using ``pytest_plugins`` in non-top-level directories when using ``--pyargs``: the
  728. current ``--pyargs`` mechanism is not reliable and might give false negatives.
  729. - `#4040 <https://github.com/pytest-dev/pytest/issues/4040>`_: Exclude empty reports for passed tests when ``-rP`` option is used.
  730. - `#4051 <https://github.com/pytest-dev/pytest/issues/4051>`_: Improve error message when an invalid Python expression is passed to the ``-m`` option.
  731. - `#4056 <https://github.com/pytest-dev/pytest/issues/4056>`_: ``MonkeyPatch.setenv`` and ``MonkeyPatch.delenv`` issue a warning if the environment variable name is not ``str`` on Python 2.
  732. In Python 2, adding ``unicode`` keys to ``os.environ`` causes problems with ``subprocess`` (and possible other modules),
  733. making this a subtle bug specially susceptible when used with ``from __future__ import unicode_literals``.
  734. Improved Documentation
  735. ----------------------
  736. - `#3928 <https://github.com/pytest-dev/pytest/issues/3928>`_: Add possible values for fixture scope to docs.
  737. pytest 3.8.1 (2018-09-22)
  738. =========================
  739. Bug Fixes
  740. ---------
  741. - `#3286 <https://github.com/pytest-dev/pytest/issues/3286>`_: ``.pytest_cache`` directory is now automatically ignored by Git. Users who would like to contribute a solution for other SCMs please consult/comment on this issue.
  742. - `#3749 <https://github.com/pytest-dev/pytest/issues/3749>`_: Fix the following error during collection of tests inside packages::
  743. TypeError: object of type 'Package' has no len()
  744. - `#3941 <https://github.com/pytest-dev/pytest/issues/3941>`_: Fix bug where indirect parametrization would consider the scope of all fixtures used by the test function to determine the parametrization scope, and not only the scope of the fixtures being parametrized.
  745. - `#3973 <https://github.com/pytest-dev/pytest/issues/3973>`_: Fix crash of the assertion rewriter if a test changed the current working directory without restoring it afterwards.
  746. - `#3998 <https://github.com/pytest-dev/pytest/issues/3998>`_: Fix issue that prevented some caplog properties (for example ``record_tuples``) from being available when entering the debugger with ``--pdb``.
  747. - `#3999 <https://github.com/pytest-dev/pytest/issues/3999>`_: Fix ``UnicodeDecodeError`` in python2.x when a class returns a non-ascii binary ``__repr__`` in an assertion which also contains non-ascii text.
  748. Improved Documentation
  749. ----------------------
  750. - `#3996 <https://github.com/pytest-dev/pytest/issues/3996>`_: New `Deprecations and Removals <https://docs.pytest.org/en/latest/deprecations.html>`_ page shows all currently
  751. deprecated features, the rationale to do so, and alternatives to update your code. It also list features removed
  752. from pytest in past major releases to help those with ancient pytest versions to upgrade.
  753. Trivial/Internal Changes
  754. ------------------------
  755. - `#3955 <https://github.com/pytest-dev/pytest/issues/3955>`_: Improve pre-commit detection for changelog filenames
  756. - `#3975 <https://github.com/pytest-dev/pytest/issues/3975>`_: Remove legacy code around im_func as that was python2 only
  757. pytest 3.8.0 (2018-09-05)
  758. =========================
  759. Deprecations and Removals
  760. -------------------------
  761. - `#2452 <https://github.com/pytest-dev/pytest/issues/2452>`_: ``Config.warn`` and ``Node.warn`` have been
  762. deprecated, see `<https://docs.pytest.org/en/latest/deprecations.html#config-warn-and-node-warn>`_ for rationale and
  763. examples.
  764. - `#3936 <https://github.com/pytest-dev/pytest/issues/3936>`_: ``@pytest.mark.filterwarnings`` second parameter is no longer regex-escaped,
  765. making it possible to actually use regular expressions to check the warning message.
  766. **Note**: regex-escaping the match string was an implementation oversight that might break test suites which depend
  767. on the old behavior.
  768. Features
  769. --------
  770. - `#2452 <https://github.com/pytest-dev/pytest/issues/2452>`_: Internal pytest warnings are now issued using the standard ``warnings`` module, making it possible to use
  771. the standard warnings filters to manage those warnings. This introduces ``PytestWarning``,
  772. ``PytestDeprecationWarning`` and ``RemovedInPytest4Warning`` warning types as part of the public API.
  773. Consult `the documentation <https://docs.pytest.org/en/latest/warnings.html#internal-pytest-warnings>`__ for more info.
  774. - `#2908 <https://github.com/pytest-dev/pytest/issues/2908>`_: ``DeprecationWarning`` and ``PendingDeprecationWarning`` are now shown by default if no other warning filter is
  775. configured. This makes pytest more compliant with
  776. `PEP-0506 <https://www.python.org/dev/peps/pep-0565/#recommended-filter-settings-for-test-runners>`_. See
  777. `the docs <https://docs.pytest.org/en/latest/warnings.html#deprecationwarning-and-pendingdeprecationwarning>`_ for
  778. more info.
  779. - `#3251 <https://github.com/pytest-dev/pytest/issues/3251>`_: Warnings are now captured and displayed during test collection.
  780. - `#3784 <https://github.com/pytest-dev/pytest/issues/3784>`_: ``PYTEST_DISABLE_PLUGIN_AUTOLOAD`` environment variable disables plugin auto-loading when set.
  781. - `#3829 <https://github.com/pytest-dev/pytest/issues/3829>`_: Added the ``count`` option to ``console_output_style`` to enable displaying the progress as a count instead of a percentage.
  782. - `#3837 <https://github.com/pytest-dev/pytest/issues/3837>`_: Added support for 'xfailed' and 'xpassed' outcomes to the ``pytester.RunResult.assert_outcomes`` signature.
  783. Bug Fixes
  784. ---------
  785. - `#3911 <https://github.com/pytest-dev/pytest/issues/3911>`_: Terminal writer now takes into account unicode character width when writing out progress.
  786. - `#3913 <https://github.com/pytest-dev/pytest/issues/3913>`_: Pytest now returns with correct exit code (EXIT_USAGEERROR, 4) when called with unknown arguments.
  787. - `#3918 <https://github.com/pytest-dev/pytest/issues/3918>`_: Improve performance of assertion rewriting.
  788. Improved Documentation
  789. ----------------------
  790. - `#3566 <https://github.com/pytest-dev/pytest/issues/3566>`_: Added a blurb in usage.rst for the usage of -r flag which is used to show an extra test summary info.
  791. - `#3907 <https://github.com/pytest-dev/pytest/issues/3907>`_: Corrected type of the exceptions collection passed to ``xfail``: ``raises`` argument accepts a ``tuple`` instead of ``list``.
  792. Trivial/Internal Changes
  793. ------------------------
  794. - `#3853 <https://github.com/pytest-dev/pytest/issues/3853>`_: Removed ``"run all (no recorded failures)"`` message printed with ``--failed-first`` and ``--last-failed`` when there are no failed tests.
  795. pytest 3.7.4 (2018-08-29)
  796. =========================
  797. Bug Fixes
  798. ---------
  799. - `#3506 <https://github.com/pytest-dev/pytest/issues/3506>`_: Fix possible infinite recursion when writing ``.pyc`` files.
  800. - `#3853 <https://github.com/pytest-dev/pytest/issues/3853>`_: Cache plugin now obeys the ``-q`` flag when ``--last-failed`` and ``--failed-first`` flags are used.
  801. - `#3883 <https://github.com/pytest-dev/pytest/issues/3883>`_: Fix bad console output when using ``console_output_style=classic``.
  802. - `#3888 <https://github.com/pytest-dev/pytest/issues/3888>`_: Fix macOS specific code using ``capturemanager`` plugin in doctests.
  803. Improved Documentation
  804. ----------------------
  805. - `#3902 <https://github.com/pytest-dev/pytest/issues/3902>`_: Fix pytest.org links
  806. pytest 3.7.3 (2018-08-26)
  807. =========================
  808. Bug Fixes
  809. ---------
  810. - `#3033 <https://github.com/pytest-dev/pytest/issues/3033>`_: Fixtures during teardown can again use ``capsys`` and ``capfd`` to inspect output captured during tests.
  811. - `#3773 <https://github.com/pytest-dev/pytest/issues/3773>`_: Fix collection of tests from ``__init__.py`` files if they match the ``python_files`` configuration option.
  812. - `#3796 <https://github.com/pytest-dev/pytest/issues/3796>`_: Fix issue where teardown of fixtures of consecutive sub-packages were executed once, at the end of the outer
  813. package.
  814. - `#3816 <https://github.com/pytest-dev/pytest/issues/3816>`_: Fix bug where ``--show-capture=no`` option would still show logs printed during fixture teardown.
  815. - `#3819 <https://github.com/pytest-dev/pytest/issues/3819>`_: Fix ``stdout/stderr`` not getting captured when real-time cli logging is active.
  816. - `#3843 <https://github.com/pytest-dev/pytest/issues/3843>`_: Fix collection error when specifying test functions directly in the command line using ``test.py::test`` syntax together with ``--doctest-modules``.
  817. - `#3848 <https://github.com/pytest-dev/pytest/issues/3848>`_: Fix bugs where unicode arguments could not be passed to ``testdir.runpytest`` on Python 2.
  818. - `#3854 <https://github.com/pytest-dev/pytest/issues/3854>`_: Fix double collection of tests within packages when the filename starts with a capital letter.
  819. Improved Documentation
  820. ----------------------
  821. - `#3824 <https://github.com/pytest-dev/pytest/issues/3824>`_: Added example for multiple glob pattern matches in ``python_files``.
  822. - `#3833 <https://github.com/pytest-dev/pytest/issues/3833>`_: Added missing docs for ``pytester.Testdir``.
  823. - `#3870 <https://github.com/pytest-dev/pytest/issues/3870>`_: Correct documentation for setuptools integration.
  824. Trivial/Internal Changes
  825. ------------------------
  826. - `#3826 <https://github.com/pytest-dev/pytest/issues/3826>`_: Replace broken type annotations with type comments.
  827. - `#3845 <https://github.com/pytest-dev/pytest/issues/3845>`_: Remove a reference to issue `#568 <https://github.com/pytest-dev/pytest/issues/568>`_ from the documentation, which has since been
  828. fixed.
  829. pytest 3.7.2 (2018-08-16)
  830. =========================
  831. Bug Fixes
  832. ---------
  833. - `#3671 <https://github.com/pytest-dev/pytest/issues/3671>`_: Fix ``filterwarnings`` not being registered as a builtin mark.
  834. - `#3768 <https://github.com/pytest-dev/pytest/issues/3768>`_, `#3789 <https://github.com/pytest-dev/pytest/issues/3789>`_: Fix test collection from packages mixed with normal directories.
  835. - `#3771 <https://github.com/pytest-dev/pytest/issues/3771>`_: Fix infinite recursion during collection if a ``pytest_ignore_collect`` hook returns ``False`` instead of ``None``.
  836. - `#3774 <https://github.com/pytest-dev/pytest/issues/3774>`_: Fix bug where decorated fixtures would lose functionality (for example ``@mock.patch``).
  837. - `#3775 <https://github.com/pytest-dev/pytest/issues/3775>`_: Fix bug where importing modules or other objects with prefix ``pytest_`` prefix would raise a ``PluginValidationError``.
  838. - `#3788 <https://github.com/pytest-dev/pytest/issues/3788>`_: Fix ``AttributeError`` during teardown of ``TestCase`` subclasses which raise an exception during ``__init__``.
  839. - `#3804 <https://github.com/pytest-dev/pytest/issues/3804>`_: Fix traceback reporting for exceptions with ``__cause__`` cycles.
  840. Improved Documentation
  841. ----------------------
  842. - `#3746 <https://github.com/pytest-dev/pytest/issues/3746>`_: Add documentation for ``metafunc.config`` that had been mistakenly hidden.
  843. pytest 3.7.1 (2018-08-02)
  844. =========================
  845. Bug Fixes
  846. ---------
  847. - `#3473 <https://github.com/pytest-dev/pytest/issues/3473>`_: Raise immediately if ``approx()`` is given an expected value of a type it doesn't understand (e.g. strings, nested dicts, etc.).
  848. - `#3712 <https://github.com/pytest-dev/pytest/issues/3712>`_: Correctly represent the dimensions of a numpy array when calling ``repr()`` on ``approx()``.
  849. - `#3742 <https://github.com/pytest-dev/pytest/issues/3742>`_: Fix incompatibility with third party plugins during collection, which produced the error ``object has no attribute '_collectfile'``.
  850. - `#3745 <https://github.com/pytest-dev/pytest/issues/3745>`_: Display the absolute path if ``cache_dir`` is not relative to the ``rootdir`` instead of failing.
  851. - `#3747 <https://github.com/pytest-dev/pytest/issues/3747>`_: Fix compatibility problem with plugins and the warning code issued by fixture functions when they are called directly.
  852. - `#3748 <https://github.com/pytest-dev/pytest/issues/3748>`_: Fix infinite recursion in ``pytest.approx`` with arrays in ``numpy<1.13``.
  853. - `#3757 <https://github.com/pytest-dev/pytest/issues/3757>`_: Pin pathlib2 to ``>=2.2.0`` as we require ``__fspath__`` support.
  854. - `#3763 <https://github.com/pytest-dev/pytest/issues/3763>`_: Fix ``TypeError`` when the assertion message is ``bytes`` in python 3.
  855. pytest 3.7.0 (2018-07-30)
  856. =========================
  857. Deprecations and Removals
  858. -------------------------
  859. - `#2639 <https://github.com/pytest-dev/pytest/issues/2639>`_: ``pytest_namespace`` has been `deprecated <https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace>`_.
  860. - `#3661 <https://github.com/pytest-dev/pytest/issues/3661>`_: Calling a fixture function directly, as opposed to request them in a test function, now issues a ``RemovedInPytest4Warning``. See `the documentation for rationale and examples <https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly>`_.
  861. Features
  862. --------
  863. - `#2283 <https://github.com/pytest-dev/pytest/issues/2283>`_: New ``package`` fixture scope: fixtures are finalized when the last test of a *package* finishes. This feature is considered **experimental**, so use it sparingly.
  864. - `#3576 <https://github.com/pytest-dev/pytest/issues/3576>`_: ``Node.add_marker`` now supports an ``append=True/False`` parameter to determine whether the mark comes last (default) or first.
  865. - `#3579 <https://github.com/pytest-dev/pytest/issues/3579>`_: Fixture ``caplog`` now has a ``messages`` property, providing convenient access to the format-interpolated log messages without the extra data provided by the formatter/handler.
  866. - `#3610 <https://github.com/pytest-dev/pytest/issues/3610>`_: New ``--trace`` option to enter the debugger at the start of a test.
  867. - `#3623 <https://github.com/pytest-dev/pytest/issues/3623>`_: Introduce ``pytester.copy_example`` as helper to do acceptance tests against examples from the project.
  868. Bug Fixes
  869. ---------
  870. - `#2220 <https://github.com/pytest-dev/pytest/issues/2220>`_: Fix a bug where fixtures overridden by direct parameters (for example parametrization) were being instantiated even if they were not being used by a test.
  871. - `#3695 <https://github.com/pytest-dev/pytest/issues/3695>`_: Fix ``ApproxNumpy`` initialisation argument mixup, ``abs`` and ``rel`` tolerances were flipped causing strange comparison results.
  872. Add tests to check ``abs`` and ``rel`` tolerances for ``np.array`` and test for expecting ``nan`` with ``np.array()``
  873. - `#980 <https://github.com/pytest-dev/pytest/issues/980>`_: Fix truncated locals output in verbose mode.
  874. Improved Documentation
  875. ----------------------
  876. - `#3295 <https://github.com/pytest-dev/pytest/issues/3295>`_: Correct the usage documentation of ``--last-failed-no-failures`` by adding the missing ``--last-failed`` argument in the presented examples, because they are misleading and lead to think that the missing argument is not needed.
  877. Trivial/Internal Changes
  878. ------------------------
  879. - `#3519 <https://github.com/pytest-dev/pytest/issues/3519>`_: Now a ``README.md`` file is created in ``.pytest_cache`` to make it clear why the directory exists.
  880. pytest 3.6.4 (2018-07-28)
  881. =========================
  882. Bug Fixes
  883. ---------
  884. - Invoke pytest using ``-mpytest`` so ``sys.path`` does not get polluted by packages installed in ``site-packages``. (`#742 <https://github.com/pytest-dev/pytest/issues/742>`_)
  885. Improved Documentation
  886. ----------------------
  887. - Use ``smtp_connection`` instead of ``smtp`` in fixtures documentation to avoid possible confusion. (`#3592 <https://github.com/pytest-dev/pytest/issues/3592>`_)
  888. Trivial/Internal Changes
  889. ------------------------
  890. - Remove obsolete ``__future__`` imports. (`#2319 <https://github.com/pytest-dev/pytest/issues/2319>`_)
  891. - Add CITATION to provide information on how to formally cite pytest. (`#3402 <https://github.com/pytest-dev/pytest/issues/3402>`_)
  892. - Replace broken type annotations with type comments. (`#3635 <https://github.com/pytest-dev/pytest/issues/3635>`_)
  893. - Pin ``pluggy`` to ``<0.8``. (`#3727 <https://github.com/pytest-dev/pytest/issues/3727>`_)
  894. pytest 3.6.3 (2018-07-04)
  895. =========================
  896. Bug Fixes
  897. ---------
  898. - Fix ``ImportWarning`` triggered by explicit relative imports in
  899. assertion-rewritten package modules. (`#3061
  900. <https://github.com/pytest-dev/pytest/issues/3061>`_)
  901. - Fix error in ``pytest.approx`` when dealing with 0-dimension numpy
  902. arrays. (`#3593 <https://github.com/pytest-dev/pytest/issues/3593>`_)
  903. - No longer raise ``ValueError`` when using the ``get_marker`` API. (`#3605
  904. <https://github.com/pytest-dev/pytest/issues/3605>`_)
  905. - Fix problem where log messages with non-ascii characters would not
  906. appear in the output log file.
  907. (`#3630 <https://github.com/pytest-dev/pytest/issues/3630>`_)
  908. - No longer raise ``AttributeError`` when legacy marks can't be stored in
  909. functions. (`#3631 <https://github.com/pytest-dev/pytest/issues/3631>`_)
  910. Improved Documentation
  911. ----------------------
  912. - The description above the example for ``@pytest.mark.skipif`` now better
  913. matches the code. (`#3611
  914. <https://github.com/pytest-dev/pytest/issues/3611>`_)
  915. Trivial/Internal Changes
  916. ------------------------
  917. - Internal refactoring: removed unused ``CallSpec2tox ._globalid_args``
  918. attribute and ``metafunc`` parameter from ``CallSpec2.copy()``. (`#3598
  919. <https://github.com/pytest-dev/pytest/issues/3598>`_)
  920. - Silence usage of ``reduce`` warning in Python 2 (`#3609
  921. <https://github.com/pytest-dev/pytest/issues/3609>`_)
  922. - Fix usage of ``attr.ib`` deprecated ``convert`` parameter. (`#3653
  923. <https://github.com/pytest-dev/pytest/issues/3653>`_)
  924. pytest 3.6.2 (2018-06-20)
  925. =========================
  926. Bug Fixes
  927. ---------
  928. - Fix regression in ``Node.add_marker`` by extracting the mark object of a
  929. ``MarkDecorator``. (`#3555
  930. <https://github.com/pytest-dev/pytest/issues/3555>`_)
  931. - Warnings without ``location`` were reported as ``None``. This is corrected to
  932. now report ``<undetermined location>``. (`#3563
  933. <https://github.com/pytest-dev/pytest/issues/3563>`_)
  934. - Continue to call finalizers in the stack when a finalizer in a former scope
  935. raises an exception. (`#3569
  936. <https://github.com/pytest-dev/pytest/issues/3569>`_)
  937. - Fix encoding error with ``print`` statements in doctests (`#3583
  938. <https://github.com/pytest-dev/pytest/issues/3583>`_)
  939. Improved Documentation
  940. ----------------------
  941. - Add documentation for the ``--strict`` flag. (`#3549
  942. <https://github.com/pytest-dev/pytest/issues/3549>`_)
  943. Trivial/Internal Changes
  944. ------------------------
  945. - Update old quotation style to parens in fixture.rst documentation. (`#3525
  946. <https://github.com/pytest-dev/pytest/issues/3525>`_)
  947. - Improve display of hint about ``--fulltrace`` with ``KeyboardInterrupt``.
  948. (`#3545 <https://github.com/pytest-dev/pytest/issues/3545>`_)
  949. - pytest's testsuite is no longer runnable through ``python setup.py test`` --
  950. instead invoke ``pytest`` or ``tox`` directly. (`#3552
  951. <https://github.com/pytest-dev/pytest/issues/3552>`_)
  952. - Fix typo in documentation (`#3567
  953. <https://github.com/pytest-dev/pytest/issues/3567>`_)
  954. pytest 3.6.1 (2018-06-05)
  955. =========================
  956. Bug Fixes
  957. ---------
  958. - Fixed a bug where stdout and stderr were logged twice by junitxml when a test
  959. was marked xfail. (`#3491
  960. <https://github.com/pytest-dev/pytest/issues/3491>`_)
  961. - Fix ``usefixtures`` mark applyed to unittest tests by correctly instantiating
  962. ``FixtureInfo``. (`#3498
  963. <https://github.com/pytest-dev/pytest/issues/3498>`_)
  964. - Fix assertion rewriter compatibility with libraries that monkey patch
  965. ``file`` objects. (`#3503
  966. <https://github.com/pytest-dev/pytest/issues/3503>`_)
  967. Improved Documentation
  968. ----------------------
  969. - Added a section on how to use fixtures as factories to the fixture
  970. documentation. (`#3461 <https://github.com/pytest-dev/pytest/issues/3461>`_)
  971. Trivial/Internal Changes
  972. ------------------------
  973. - Enable caching for pip/pre-commit in order to reduce build time on
  974. travis/appveyor. (`#3502
  975. <https://github.com/pytest-dev/pytest/issues/3502>`_)
  976. - Switch pytest to the src/ layout as we already suggested it for good practice
  977. - now we implement it as well. (`#3513
  978. <https://github.com/pytest-dev/pytest/issues/3513>`_)
  979. - Fix if in tests to support 3.7.0b5, where a docstring handling in AST got
  980. reverted. (`#3530 <https://github.com/pytest-dev/pytest/issues/3530>`_)
  981. - Remove some python2.5 compatibility code. (`#3529
  982. <https://github.com/pytest-dev/pytest/issues/3529>`_)
  983. pytest 3.6.0 (2018-05-23)
  984. =========================
  985. Features
  986. --------
  987. - Revamp the internals of the ``pytest.mark`` implementation with correct per
  988. node handling which fixes a number of long standing bugs caused by the old
  989. design. This introduces new ``Node.iter_markers(name)`` and
  990. ``Node.get_closest_marker(name)`` APIs. Users are **strongly encouraged** to
  991. read the `reasons for the revamp in the docs
  992. <https://docs.pytest.org/en/latest/mark.html#marker-revamp-and-iteration>`_,
  993. or jump over to details about `updating existing code to use the new APIs
  994. <https://docs.pytest.org/en/latest/mark.html#updating-code>`_. (`#3317
  995. <https://github.com/pytest-dev/pytest/issues/3317>`_)
  996. - Now when ``@pytest.fixture`` is applied more than once to the same function a
  997. ``ValueError`` is raised. This buggy behavior would cause surprising problems
  998. and if was working for a test suite it was mostly by accident. (`#2334
  999. <https://github.com/pytest-dev/pytest/issues/2334>`_)
  1000. - Support for Python 3.7's builtin ``breakpoint()`` method, see `Using the
  1001. builtin breakpoint function
  1002. <https://docs.pytest.org/en/latest/usage.html#breakpoint-builtin>`_ for
  1003. details. (`#3180 <https://github.com/pytest-dev/pytest/issues/3180>`_)
  1004. - ``monkeypatch`` now supports a ``context()`` function which acts as a context
  1005. manager which undoes all patching done within the ``with`` block. (`#3290
  1006. <https://github.com/pytest-dev/pytest/issues/3290>`_)
  1007. - The ``--pdb`` option now causes KeyboardInterrupt to enter the debugger,
  1008. instead of stopping the test session. On python 2.7, hitting CTRL+C again
  1009. exits the debugger. On python 3.2 and higher, use CTRL+D. (`#3299
  1010. <https://github.com/pytest-dev/pytest/issues/3299>`_)
  1011. - pytest no longer changes the log level of the root logger when the
  1012. ``log-level`` parameter has greater numeric value than that of the level of
  1013. the root logger, which makes it play better with custom logging configuration
  1014. in user code. (`#3307 <https://github.com/pytest-dev/pytest/issues/3307>`_)
  1015. Bug Fixes
  1016. ---------
  1017. - A rare race-condition which might result in corrupted ``.pyc`` files on
  1018. Windows has been hopefully solved. (`#3008
  1019. <https://github.com/pytest-dev/pytest/issues/3008>`_)
  1020. - Also use iter_marker for discovering the marks applying for marker
  1021. expressions from the cli to avoid the bad data from the legacy mark storage.
  1022. (`#3441 <https://github.com/pytest-dev/pytest/issues/3441>`_)
  1023. - When showing diffs of failed assertions where the contents contain only
  1024. whitespace, escape them using ``repr()`` first to make it easy to spot the
  1025. differences. (`#3443 <https://github.com/pytest-dev/pytest/issues/3443>`_)
  1026. Improved Documentation
  1027. ----------------------
  1028. - Change documentation copyright year to a range which auto-updates itself each
  1029. time it is published. (`#3303
  1030. <https://github.com/pytest-dev/pytest/issues/3303>`_)
  1031. Trivial/Internal Changes
  1032. ------------------------
  1033. - ``pytest`` now depends on the `python-atomicwrites
  1034. <https://github.com/untitaker/python-atomicwrites>`_ library. (`#3008
  1035. <https://github.com/pytest-dev/pytest/issues/3008>`_)
  1036. - Update all pypi.python.org URLs to pypi.org. (`#3431
  1037. <https://github.com/pytest-dev/pytest/issues/3431>`_)
  1038. - Detect `pytest_` prefixed hooks using the internal plugin manager since
  1039. ``pluggy`` is deprecating the ``implprefix`` argument to ``PluginManager``.
  1040. (`#3487 <https://github.com/pytest-dev/pytest/issues/3487>`_)
  1041. - Import ``Mapping`` and ``Sequence`` from ``_pytest.compat`` instead of
  1042. directly from ``collections`` in ``python_api.py::approx``. Add ``Mapping``
  1043. to ``_pytest.compat``, import it from ``collections`` on python 2, but from
  1044. ``collections.abc`` on Python 3 to avoid a ``DeprecationWarning`` on Python
  1045. 3.7 or newer. (`#3497 <https://github.com/pytest-dev/pytest/issues/3497>`_)
  1046. pytest 3.5.1 (2018-04-23)
  1047. =========================
  1048. Bug Fixes
  1049. ---------
  1050. - Reset ``sys.last_type``, ``sys.last_value`` and ``sys.last_traceback`` before
  1051. each test executes. Those attributes are added by pytest during the test run
  1052. to aid debugging, but were never reset so they would create a leaking
  1053. reference to the last failing test's frame which in turn could never be
  1054. reclaimed by the garbage collector. (`#2798
  1055. <https://github.com/pytest-dev/pytest/issues/2798>`_)
  1056. - ``pytest.raises`` now raises ``TypeError`` when receiving an unknown keyword
  1057. argument. (`#3348 <https://github.com/pytest-dev/pytest/issues/3348>`_)
  1058. - ``pytest.raises`` now works with exception classes that look like iterables.
  1059. (`#3372 <https://github.com/pytest-dev/pytest/issues/3372>`_)
  1060. Improved Documentation
  1061. ----------------------
  1062. - Fix typo in ``caplog`` fixture documentation, which incorrectly identified
  1063. certain attributes as methods. (`#3406
  1064. <https://github.com/pytest-dev/pytest/issues/3406>`_)
  1065. Trivial/Internal Changes
  1066. ------------------------
  1067. - Added a more indicative error message when parametrizing a function whose
  1068. argument takes a default value. (`#3221
  1069. <https://github.com/pytest-dev/pytest/issues/3221>`_)
  1070. - Remove internal ``_pytest.terminal.flatten`` function in favor of
  1071. ``more_itertools.collapse``. (`#3330
  1072. <https://github.com/pytest-dev/pytest/issues/3330>`_)
  1073. - Import some modules from ``collections.abc`` instead of ``collections`` as
  1074. the former modules trigger ``DeprecationWarning`` in Python 3.7. (`#3339
  1075. <https://github.com/pytest-dev/pytest/issues/3339>`_)
  1076. - record_property is no longer experimental, removing the warnings was
  1077. forgotten. (`#3360 <https://github.com/pytest-dev/pytest/issues/3360>`_)
  1078. - Mention in documentation and CLI help that fixtures with leading ``_`` are
  1079. printed by ``pytest --fixtures`` only if the ``-v`` option is added. (`#3398
  1080. <https://github.com/pytest-dev/pytest/issues/3398>`_)
  1081. pytest 3.5.0 (2018-03-21)
  1082. =========================
  1083. Deprecations and Removals
  1084. -------------------------
  1085. - ``record_xml_property`` fixture is now deprecated in favor of the more
  1086. generic ``record_property``. (`#2770
  1087. <https://github.com/pytest-dev/pytest/issues/2770>`_)
  1088. - Defining ``pytest_plugins`` is now deprecated in non-top-level conftest.py
  1089. files, because they "leak" to the entire directory tree. `See the docs <https://docs.pytest.org/en/latest/deprecations.html#pytest-plugins-in-non-top-level-conftest-files>`_ for the rationale behind this decision (`#3084
  1090. <https://github.com/pytest-dev/pytest/issues/3084>`_)
  1091. Features
  1092. --------
  1093. - New ``--show-capture`` command-line option that allows to specify how to
  1094. display captured output when tests fail: ``no``, ``stdout``, ``stderr``,
  1095. ``log`` or ``all`` (the default). (`#1478
  1096. <https://github.com/pytest-dev/pytest/issues/1478>`_)
  1097. - New ``--rootdir`` command-line option to override the rules for discovering
  1098. the root directory. See `customize
  1099. <https://docs.pytest.org/en/latest/customize.html>`_ in the documentation for
  1100. details. (`#1642 <https://github.com/pytest-dev/pytest/issues/1642>`_)
  1101. - Fixtures are now instantiated based on their scopes, with higher-scoped
  1102. fixtures (such as ``session``) being instantiated first than lower-scoped
  1103. fixtures (such as ``function``). The relative order of fixtures of the same
  1104. scope is kept unchanged, based in their declaration order and their
  1105. dependencies. (`#2405 <https://github.com/pytest-dev/pytest/issues/2405>`_)
  1106. - ``record_xml_property`` renamed to ``record_property`` and is now compatible
  1107. with xdist, markers and any reporter. ``record_xml_property`` name is now
  1108. deprecated. (`#2770 <https://github.com/pytest-dev/pytest/issues/2770>`_)
  1109. - New ``--nf``, ``--new-first`` options: run new tests first followed by the
  1110. rest of the tests, in both cases tests are also sorted by the file modified
  1111. time, with more recent files coming first. (`#3034
  1112. <https://github.com/pytest-dev/pytest/issues/3034>`_)
  1113. - New ``--last-failed-no-failures`` command-line option that allows to specify
  1114. the behavior of the cache plugin's ```--last-failed`` feature when no tests
  1115. failed in the last run (or no cache was found): ``none`` or ``all`` (the
  1116. default). (`#3139 <https://github.com/pytest-dev/pytest/issues/3139>`_)
  1117. - New ``--doctest-continue-on-failure`` command-line option to enable doctests
  1118. to show multiple failures for each snippet, instead of stopping at the first
  1119. failure. (`#3149 <https://github.com/pytest-dev/pytest/issues/3149>`_)
  1120. - Captured log messages are added to the ``<system-out>`` tag in the generated
  1121. junit xml file if the ``junit_logging`` ini option is set to ``system-out``.
  1122. If the value of this ini option is ``system-err``, the logs are written to
  1123. ``<system-err>``. The default value for ``junit_logging`` is ``no``, meaning
  1124. captured logs are not written to the output file. (`#3156
  1125. <https://github.com/pytest-dev/pytest/issues/3156>`_)
  1126. - Allow the logging plugin to handle ``pytest_runtest_logstart`` and
  1127. ``pytest_runtest_logfinish`` hooks when live logs are enabled. (`#3189
  1128. <https://github.com/pytest-dev/pytest/issues/3189>`_)
  1129. - Passing ``--log-cli-level`` in the command-line now automatically activates
  1130. live logging. (`#3190 <https://github.com/pytest-dev/pytest/issues/3190>`_)
  1131. - Add command line option ``--deselect`` to allow deselection of individual
  1132. tests at collection time. (`#3198
  1133. <https://github.com/pytest-dev/pytest/issues/3198>`_)
  1134. - Captured logs are printed before entering pdb. (`#3204
  1135. <https://github.com/pytest-dev/pytest/issues/3204>`_)
  1136. - Deselected item count is now shown before tests are run, e.g. ``collected X
  1137. items / Y deselected``. (`#3213
  1138. <https://github.com/pytest-dev/pytest/issues/3213>`_)
  1139. - The builtin module ``platform`` is now available for use in expressions in
  1140. ``pytest.mark``. (`#3236
  1141. <https://github.com/pytest-dev/pytest/issues/3236>`_)
  1142. - The *short test summary info* section now is displayed after tracebacks and
  1143. warnings in the terminal. (`#3255
  1144. <https://github.com/pytest-dev/pytest/issues/3255>`_)
  1145. - New ``--verbosity`` flag to set verbosity level explicitly. (`#3296
  1146. <https://github.com/pytest-dev/pytest/issues/3296>`_)
  1147. - ``pytest.approx`` now accepts comparing a numpy array with a scalar. (`#3312
  1148. <https://github.com/pytest-dev/pytest/issues/3312>`_)
  1149. Bug Fixes
  1150. ---------
  1151. - Suppress ``IOError`` when closing the temporary file used for capturing
  1152. streams in Python 2.7. (`#2370
  1153. <https://github.com/pytest-dev/pytest/issues/2370>`_)
  1154. - Fixed ``clear()`` method on ``caplog`` fixture which cleared ``records``, but
  1155. not the ``text`` property. (`#3297
  1156. <https://github.com/pytest-dev/pytest/issues/3297>`_)
  1157. - During test collection, when stdin is not allowed to be read, the
  1158. ``DontReadFromStdin`` object still allow itself to be iterable and resolved
  1159. to an iterator without crashing. (`#3314
  1160. <https://github.com/pytest-dev/pytest/issues/3314>`_)
  1161. Improved Documentation
  1162. ----------------------
  1163. - Added a `reference <https://docs.pytest.org/en/latest/reference.html>`_ page
  1164. to the docs. (`#1713 <https://github.com/pytest-dev/pytest/issues/1713>`_)
  1165. Trivial/Internal Changes
  1166. ------------------------
  1167. - Change minimum requirement of ``attrs`` to ``17.4.0``. (`#3228
  1168. <https://github.com/pytest-dev/pytest/issues/3228>`_)
  1169. - Renamed example directories so all tests pass when ran from the base
  1170. directory. (`#3245 <https://github.com/pytest-dev/pytest/issues/3245>`_)
  1171. - Internal ``mark.py`` module has been turned into a package. (`#3250
  1172. <https://github.com/pytest-dev/pytest/issues/3250>`_)
  1173. - ``pytest`` now depends on the `more-itertools
  1174. <https://github.com/erikrose/more-itertools>`_ package. (`#3265
  1175. <https://github.com/pytest-dev/pytest/issues/3265>`_)
  1176. - Added warning when ``[pytest]`` section is used in a ``.cfg`` file passed
  1177. with ``-c`` (`#3268 <https://github.com/pytest-dev/pytest/issues/3268>`_)
  1178. - ``nodeids`` can now be passed explicitly to ``FSCollector`` and ``Node``
  1179. constructors. (`#3291 <https://github.com/pytest-dev/pytest/issues/3291>`_)
  1180. - Internal refactoring of ``FormattedExcinfo`` to use ``attrs`` facilities and
  1181. remove old support code for legacy Python versions. (`#3292
  1182. <https://github.com/pytest-dev/pytest/issues/3292>`_)
  1183. - Refactoring to unify how verbosity is handled internally. (`#3296
  1184. <https://github.com/pytest-dev/pytest/issues/3296>`_)
  1185. - Internal refactoring to better integrate with argparse. (`#3304
  1186. <https://github.com/pytest-dev/pytest/issues/3304>`_)
  1187. - Fix a python example when calling a fixture in doc/en/usage.rst (`#3308
  1188. <https://github.com/pytest-dev/pytest/issues/3308>`_)
  1189. pytest 3.4.2 (2018-03-04)
  1190. =========================
  1191. Bug Fixes
  1192. ---------
  1193. - Removed progress information when capture option is ``no``. (`#3203
  1194. <https://github.com/pytest-dev/pytest/issues/3203>`_)
  1195. - Refactor check of bindir from ``exists`` to ``isdir``. (`#3241
  1196. <https://github.com/pytest-dev/pytest/issues/3241>`_)
  1197. - Fix ``TypeError`` issue when using ``approx`` with a ``Decimal`` value.
  1198. (`#3247 <https://github.com/pytest-dev/pytest/issues/3247>`_)
  1199. - Fix reference cycle generated when using the ``request`` fixture. (`#3249
  1200. <https://github.com/pytest-dev/pytest/issues/3249>`_)
  1201. - ``[tool:pytest]`` sections in ``*.cfg`` files passed by the ``-c`` option are
  1202. now properly recognized. (`#3260
  1203. <https://github.com/pytest-dev/pytest/issues/3260>`_)
  1204. Improved Documentation
  1205. ----------------------
  1206. - Add logging plugin to plugins list. (`#3209
  1207. <https://github.com/pytest-dev/pytest/issues/3209>`_)
  1208. Trivial/Internal Changes
  1209. ------------------------
  1210. - Fix minor typo in fixture.rst (`#3259
  1211. <https://github.com/pytest-dev/pytest/issues/3259>`_)
  1212. pytest 3.4.1 (2018-02-20)
  1213. =========================
  1214. Bug Fixes
  1215. ---------
  1216. - Move import of ``doctest.UnexpectedException`` to top-level to avoid possible
  1217. errors when using ``--pdb``. (`#1810
  1218. <https://github.com/pytest-dev/pytest/issues/1810>`_)
  1219. - Added printing of captured stdout/stderr before entering pdb, and improved a
  1220. test which was giving false negatives about output capturing. (`#3052
  1221. <https://github.com/pytest-dev/pytest/issues/3052>`_)
  1222. - Fix ordering of tests using parametrized fixtures which can lead to fixtures
  1223. being created more than necessary. (`#3161
  1224. <https://github.com/pytest-dev/pytest/issues/3161>`_)
  1225. - Fix bug where logging happening at hooks outside of "test run" hooks would
  1226. cause an internal error. (`#3184
  1227. <https://github.com/pytest-dev/pytest/issues/3184>`_)
  1228. - Detect arguments injected by ``unittest.mock.patch`` decorator correctly when
  1229. pypi ``mock.patch`` is installed and imported. (`#3206
  1230. <https://github.com/pytest-dev/pytest/issues/3206>`_)
  1231. - Errors shown when a ``pytest.raises()`` with ``match=`` fails are now cleaner
  1232. on what happened: When no exception was raised, the "matching '...'" part got
  1233. removed as it falsely implies that an exception was raised but it didn't
  1234. match. When a wrong exception was raised, it's now thrown (like
  1235. ``pytest.raised()`` without ``match=`` would) instead of complaining about
  1236. the unmatched text. (`#3222
  1237. <https://github.com/pytest-dev/pytest/issues/3222>`_)
  1238. - Fixed output capture handling in doctests on macOS. (`#985
  1239. <https://github.com/pytest-dev/pytest/issues/985>`_)
  1240. Improved Documentation
  1241. ----------------------
  1242. - Add Sphinx parameter docs for ``match`` and ``message`` args to
  1243. ``pytest.raises``. (`#3202
  1244. <https://github.com/pytest-dev/pytest/issues/3202>`_)
  1245. Trivial/Internal Changes
  1246. ------------------------
  1247. - pytest has changed the publication procedure and is now being published to
  1248. PyPI directly from Travis. (`#3060
  1249. <https://github.com/pytest-dev/pytest/issues/3060>`_)
  1250. - Rename ``ParameterSet._for_parameterize()`` to ``_for_parametrize()`` in
  1251. order to comply with the naming convention. (`#3166
  1252. <https://github.com/pytest-dev/pytest/issues/3166>`_)
  1253. - Skip failing pdb/doctest test on mac. (`#985
  1254. <https://github.com/pytest-dev/pytest/issues/985>`_)
  1255. pytest 3.4.0 (2018-01-30)
  1256. =========================
  1257. Deprecations and Removals
  1258. -------------------------
  1259. - All pytest classes now subclass ``object`` for better Python 2/3 compatibility.
  1260. This should not affect user code except in very rare edge cases. (`#2147
  1261. <https://github.com/pytest-dev/pytest/issues/2147>`_)
  1262. Features
  1263. --------
  1264. - Introduce ``empty_parameter_set_mark`` ini option to select which mark to
  1265. apply when ``@pytest.mark.parametrize`` is given an empty set of parameters.
  1266. Valid options are ``skip`` (default) and ``xfail``. Note that it is planned
  1267. to change the default to ``xfail`` in future releases as this is considered
  1268. less error prone. (`#2527
  1269. <https://github.com/pytest-dev/pytest/issues/2527>`_)
  1270. - **Incompatible change**: after community feedback the `logging
  1271. <https://docs.pytest.org/en/latest/logging.html>`_ functionality has
  1272. undergone some changes. Please consult the `logging documentation
  1273. <https://docs.pytest.org/en/latest/logging.html#incompatible-changes-in-pytest-3-4>`_
  1274. for details. (`#3013 <https://github.com/pytest-dev/pytest/issues/3013>`_)
  1275. - Console output falls back to "classic" mode when capturing is disabled (``-s``),
  1276. otherwise the output gets garbled to the point of being useless. (`#3038
  1277. <https://github.com/pytest-dev/pytest/issues/3038>`_)
  1278. - New `pytest_runtest_logfinish
  1279. <https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_runtest_logfinish>`_
  1280. hook which is called when a test item has finished executing, analogous to
  1281. `pytest_runtest_logstart
  1282. <https://docs.pytest.org/en/latest/writing_plugins.html#_pytest.hookspec.pytest_runtest_start>`_.
  1283. (`#3101 <https://github.com/pytest-dev/pytest/issues/3101>`_)
  1284. - Improve performance when collecting tests using many fixtures. (`#3107
  1285. <https://github.com/pytest-dev/pytest/issues/3107>`_)
  1286. - New ``caplog.get_records(when)`` method which provides access to the captured
  1287. records for the ``"setup"``, ``"call"`` and ``"teardown"``
  1288. testing stages. (`#3117 <https://github.com/pytest-dev/pytest/issues/3117>`_)
  1289. - New fixture ``record_xml_attribute`` that allows modifying and inserting
  1290. attributes on the ``<testcase>`` xml node in JUnit reports. (`#3130
  1291. <https://github.com/pytest-dev/pytest/issues/3130>`_)
  1292. - The default cache directory has been renamed from ``.cache`` to
  1293. ``.pytest_cache`` after community feedback that the name ``.cache`` did not
  1294. make it clear that it was used by pytest. (`#3138
  1295. <https://github.com/pytest-dev/pytest/issues/3138>`_)
  1296. - Colorize the levelname column in the live-log output. (`#3142
  1297. <https://github.com/pytest-dev/pytest/issues/3142>`_)
  1298. Bug Fixes
  1299. ---------
  1300. - Fix hanging pexpect test on MacOS by using flush() instead of wait().
  1301. (`#2022 <https://github.com/pytest-dev/pytest/issues/2022>`_)
  1302. - Fix restoring Python state after in-process pytest runs with the
  1303. ``pytester`` plugin; this may break tests using multiple inprocess
  1304. pytest runs if later ones depend on earlier ones leaking global interpreter
  1305. changes. (`#3016 <https://github.com/pytest-dev/pytest/issues/3016>`_)
  1306. - Fix skipping plugin reporting hook when test aborted before plugin setup
  1307. hook. (`#3074 <https://github.com/pytest-dev/pytest/issues/3074>`_)
  1308. - Fix progress percentage reported when tests fail during teardown. (`#3088
  1309. <https://github.com/pytest-dev/pytest/issues/3088>`_)
  1310. - **Incompatible change**: ``-o/--override`` option no longer eats all the
  1311. remaining options, which can lead to surprising behavior: for example,
  1312. ``pytest -o foo=1 /path/to/test.py`` would fail because ``/path/to/test.py``
  1313. would be considered as part of the ``-o`` command-line argument. One
  1314. consequence of this is that now multiple configuration overrides need
  1315. multiple ``-o`` flags: ``pytest -o foo=1 -o bar=2``. (`#3103
  1316. <https://github.com/pytest-dev/pytest/issues/3103>`_)
  1317. Improved Documentation
  1318. ----------------------
  1319. - Document hooks (defined with ``historic=True``) which cannot be used with
  1320. ``hookwrapper=True``. (`#2423
  1321. <https://github.com/pytest-dev/pytest/issues/2423>`_)
  1322. - Clarify that warning capturing doesn't change the warning filter by default.
  1323. (`#2457 <https://github.com/pytest-dev/pytest/issues/2457>`_)
  1324. - Clarify a possible confusion when using pytest_fixture_setup with fixture
  1325. functions that return None. (`#2698
  1326. <https://github.com/pytest-dev/pytest/issues/2698>`_)
  1327. - Fix the wording of a sentence on doctest flags used in pytest. (`#3076
  1328. <https://github.com/pytest-dev/pytest/issues/3076>`_)
  1329. - Prefer ``https://*.readthedocs.io`` over ``http://*.rtfd.org`` for links in
  1330. the documentation. (`#3092
  1331. <https://github.com/pytest-dev/pytest/issues/3092>`_)
  1332. - Improve readability (wording, grammar) of Getting Started guide (`#3131
  1333. <https://github.com/pytest-dev/pytest/issues/3131>`_)
  1334. - Added note that calling pytest.main multiple times from the same process is
  1335. not recommended because of import caching. (`#3143
  1336. <https://github.com/pytest-dev/pytest/issues/3143>`_)
  1337. Trivial/Internal Changes
  1338. ------------------------
  1339. - Show a simple and easy error when keyword expressions trigger a syntax error
  1340. (for example, ``"-k foo and import"`` will show an error that you can not use
  1341. the ``import`` keyword in expressions). (`#2953
  1342. <https://github.com/pytest-dev/pytest/issues/2953>`_)
  1343. - Change parametrized automatic test id generation to use the ``__name__``
  1344. attribute of functions instead of the fallback argument name plus counter.
  1345. (`#2976 <https://github.com/pytest-dev/pytest/issues/2976>`_)
  1346. - Replace py.std with stdlib imports. (`#3067
  1347. <https://github.com/pytest-dev/pytest/issues/3067>`_)
  1348. - Corrected 'you' to 'your' in logging docs. (`#3129
  1349. <https://github.com/pytest-dev/pytest/issues/3129>`_)
  1350. pytest 3.3.2 (2017-12-25)
  1351. =========================
  1352. Bug Fixes
  1353. ---------
  1354. - pytester: ignore files used to obtain current user metadata in the fd leak
  1355. detector. (`#2784 <https://github.com/pytest-dev/pytest/issues/2784>`_)
  1356. - Fix **memory leak** where objects returned by fixtures were never destructed
  1357. by the garbage collector. (`#2981
  1358. <https://github.com/pytest-dev/pytest/issues/2981>`_)
  1359. - Fix conversion of pyargs to filename to not convert symlinks on Python 2. (`#2985
  1360. <https://github.com/pytest-dev/pytest/issues/2985>`_)
  1361. - ``PYTEST_DONT_REWRITE`` is now checked for plugins too rather than only for
  1362. test modules. (`#2995 <https://github.com/pytest-dev/pytest/issues/2995>`_)
  1363. Improved Documentation
  1364. ----------------------
  1365. - Add clarifying note about behavior of multiple parametrized arguments (`#3001
  1366. <https://github.com/pytest-dev/pytest/issues/3001>`_)
  1367. Trivial/Internal Changes
  1368. ------------------------
  1369. - Code cleanup. (`#3015 <https://github.com/pytest-dev/pytest/issues/3015>`_,
  1370. `#3021 <https://github.com/pytest-dev/pytest/issues/3021>`_)
  1371. - Clean up code by replacing imports and references of ``_ast`` to ``ast``.
  1372. (`#3018 <https://github.com/pytest-dev/pytest/issues/3018>`_)
  1373. pytest 3.3.1 (2017-12-05)
  1374. =========================
  1375. Bug Fixes
  1376. ---------
  1377. - Fix issue about ``-p no:<plugin>`` having no effect. (`#2920
  1378. <https://github.com/pytest-dev/pytest/issues/2920>`_)
  1379. - Fix regression with warnings that contained non-strings in their arguments in
  1380. Python 2. (`#2956 <https://github.com/pytest-dev/pytest/issues/2956>`_)
  1381. - Always escape null bytes when setting ``PYTEST_CURRENT_TEST``. (`#2957
  1382. <https://github.com/pytest-dev/pytest/issues/2957>`_)
  1383. - Fix ``ZeroDivisionError`` when using the ``testmon`` plugin when no tests
  1384. were actually collected. (`#2971
  1385. <https://github.com/pytest-dev/pytest/issues/2971>`_)
  1386. - Bring back ``TerminalReporter.writer`` as an alias to
  1387. ``TerminalReporter._tw``. This alias was removed by accident in the ``3.3.0``
  1388. release. (`#2984 <https://github.com/pytest-dev/pytest/issues/2984>`_)
  1389. - The ``pytest-capturelog`` plugin is now also blacklisted, avoiding errors when
  1390. running pytest with it still installed. (`#3004
  1391. <https://github.com/pytest-dev/pytest/issues/3004>`_)
  1392. Improved Documentation
  1393. ----------------------
  1394. - Fix broken link to plugin ``pytest-localserver``. (`#2963
  1395. <https://github.com/pytest-dev/pytest/issues/2963>`_)
  1396. Trivial/Internal Changes
  1397. ------------------------
  1398. - Update github "bugs" link in ``CONTRIBUTING.rst`` (`#2949
  1399. <https://github.com/pytest-dev/pytest/issues/2949>`_)
  1400. pytest 3.3.0 (2017-11-23)
  1401. =========================
  1402. Deprecations and Removals
  1403. -------------------------
  1404. - pytest no longer supports Python **2.6** and **3.3**. Those Python versions
  1405. are EOL for some time now and incur maintenance and compatibility costs on
  1406. the pytest core team, and following up with the rest of the community we
  1407. decided that they will no longer be supported starting on this version. Users
  1408. which still require those versions should pin pytest to ``<3.3``. (`#2812
  1409. <https://github.com/pytest-dev/pytest/issues/2812>`_)
  1410. - Remove internal ``_preloadplugins()`` function. This removal is part of the
  1411. ``pytest_namespace()`` hook deprecation. (`#2636
  1412. <https://github.com/pytest-dev/pytest/issues/2636>`_)
  1413. - Internally change ``CallSpec2`` to have a list of marks instead of a broken
  1414. mapping of keywords. This removes the keywords attribute of the internal
  1415. ``CallSpec2`` class. (`#2672
  1416. <https://github.com/pytest-dev/pytest/issues/2672>`_)
  1417. - Remove ParameterSet.deprecated_arg_dict - its not a public api and the lack
  1418. of the underscore was a naming error. (`#2675
  1419. <https://github.com/pytest-dev/pytest/issues/2675>`_)
  1420. - Remove the internal multi-typed attribute ``Node._evalskip`` and replace it
  1421. with the boolean ``Node._skipped_by_mark``. (`#2767
  1422. <https://github.com/pytest-dev/pytest/issues/2767>`_)
  1423. - The ``params`` list passed to ``pytest.fixture`` is now for
  1424. all effects considered immutable and frozen at the moment of the ``pytest.fixture``
  1425. call. Previously the list could be changed before the first invocation of the fixture
  1426. allowing for a form of dynamic parametrization (for example, updated from command-line options),
  1427. but this was an unwanted implementation detail which complicated the internals and prevented
  1428. some internal cleanup. See issue `#2959 <https://github.com/pytest-dev/pytest/issues/2959>`_
  1429. for details and a recommended workaround.
  1430. Features
  1431. --------
  1432. - ``pytest_fixture_post_finalizer`` hook can now receive a ``request``
  1433. argument. (`#2124 <https://github.com/pytest-dev/pytest/issues/2124>`_)
  1434. - Replace the old introspection code in compat.py that determines the available
  1435. arguments of fixtures with inspect.signature on Python 3 and
  1436. funcsigs.signature on Python 2. This should respect ``__signature__``
  1437. declarations on functions. (`#2267
  1438. <https://github.com/pytest-dev/pytest/issues/2267>`_)
  1439. - Report tests with global ``pytestmark`` variable only once. (`#2549
  1440. <https://github.com/pytest-dev/pytest/issues/2549>`_)
  1441. - Now pytest displays the total progress percentage while running tests. The
  1442. previous output style can be set by configuring the ``console_output_style``
  1443. setting to ``classic``. (`#2657 <https://github.com/pytest-dev/pytest/issues/2657>`_)
  1444. - Match ``warns`` signature to ``raises`` by adding ``match`` keyword. (`#2708
  1445. <https://github.com/pytest-dev/pytest/issues/2708>`_)
  1446. - pytest now captures and displays output from the standard ``logging`` module.
  1447. The user can control the logging level to be captured by specifying options
  1448. in ``pytest.ini``, the command line and also during individual tests using
  1449. markers. Also, a ``caplog`` fixture is available that enables users to test
  1450. the captured log during specific tests (similar to ``capsys`` for example).
  1451. For more information, please see the `logging docs
  1452. <https://docs.pytest.org/en/latest/logging.html>`_. This feature was
  1453. introduced by merging the popular `pytest-catchlog
  1454. <https://pypi.org/project/pytest-catchlog/>`_ plugin, thanks to `Thomas Hisch
  1455. <https://github.com/thisch>`_. Be advised that during the merging the
  1456. backward compatibility interface with the defunct ``pytest-capturelog`` has
  1457. been dropped. (`#2794 <https://github.com/pytest-dev/pytest/issues/2794>`_)
  1458. - Add ``allow_module_level`` kwarg to ``pytest.skip()``, enabling to skip the
  1459. whole module. (`#2808 <https://github.com/pytest-dev/pytest/issues/2808>`_)
  1460. - Allow setting ``file_or_dir``, ``-c``, and ``-o`` in PYTEST_ADDOPTS. (`#2824
  1461. <https://github.com/pytest-dev/pytest/issues/2824>`_)
  1462. - Return stdout/stderr capture results as a ``namedtuple``, so ``out`` and
  1463. ``err`` can be accessed by attribute. (`#2879
  1464. <https://github.com/pytest-dev/pytest/issues/2879>`_)
  1465. - Add ``capfdbinary``, a version of ``capfd`` which returns bytes from
  1466. ``readouterr()``. (`#2923
  1467. <https://github.com/pytest-dev/pytest/issues/2923>`_)
  1468. - Add ``capsysbinary`` a version of ``capsys`` which returns bytes from
  1469. ``readouterr()``. (`#2934
  1470. <https://github.com/pytest-dev/pytest/issues/2934>`_)
  1471. - Implement feature to skip ``setup.py`` files when run with
  1472. ``--doctest-modules``. (`#502
  1473. <https://github.com/pytest-dev/pytest/issues/502>`_)
  1474. Bug Fixes
  1475. ---------
  1476. - Resume output capturing after ``capsys/capfd.disabled()`` context manager.
  1477. (`#1993 <https://github.com/pytest-dev/pytest/issues/1993>`_)
  1478. - ``pytest_fixture_setup`` and ``pytest_fixture_post_finalizer`` hooks are now
  1479. called for all ``conftest.py`` files. (`#2124
  1480. <https://github.com/pytest-dev/pytest/issues/2124>`_)
  1481. - If an exception happens while loading a plugin, pytest no longer hides the
  1482. original traceback. In Python 2 it will show the original traceback with a new
  1483. message that explains in which plugin. In Python 3 it will show 2 canonized
  1484. exceptions, the original exception while loading the plugin in addition to an
  1485. exception that pytest throws about loading a plugin. (`#2491
  1486. <https://github.com/pytest-dev/pytest/issues/2491>`_)
  1487. - ``capsys`` and ``capfd`` can now be used by other fixtures. (`#2709
  1488. <https://github.com/pytest-dev/pytest/issues/2709>`_)
  1489. - Internal ``pytester`` plugin properly encodes ``bytes`` arguments to
  1490. ``utf-8``. (`#2738 <https://github.com/pytest-dev/pytest/issues/2738>`_)
  1491. - ``testdir`` now uses use the same method used by ``tmpdir`` to create its
  1492. temporary directory. This changes the final structure of the ``testdir``
  1493. directory slightly, but should not affect usage in normal scenarios and
  1494. avoids a number of potential problems. (`#2751
  1495. <https://github.com/pytest-dev/pytest/issues/2751>`_)
  1496. - pytest no longer complains about warnings with unicode messages being
  1497. non-ascii compatible even for ascii-compatible messages. As a result of this,
  1498. warnings with unicode messages are converted first to an ascii representation
  1499. for safety. (`#2809 <https://github.com/pytest-dev/pytest/issues/2809>`_)
  1500. - Change return value of pytest command when ``--maxfail`` is reached from
  1501. ``2`` (interrupted) to ``1`` (failed). (`#2845
  1502. <https://github.com/pytest-dev/pytest/issues/2845>`_)
  1503. - Fix issue in assertion rewriting which could lead it to rewrite modules which
  1504. should not be rewritten. (`#2939
  1505. <https://github.com/pytest-dev/pytest/issues/2939>`_)
  1506. - Handle marks without description in ``pytest.ini``. (`#2942
  1507. <https://github.com/pytest-dev/pytest/issues/2942>`_)
  1508. Trivial/Internal Changes
  1509. ------------------------
  1510. - pytest now depends on `attrs <https://pypi.org/project/attrs/>`__ for internal
  1511. structures to ease code maintainability. (`#2641
  1512. <https://github.com/pytest-dev/pytest/issues/2641>`_)
  1513. - Refactored internal Python 2/3 compatibility code to use ``six``. (`#2642
  1514. <https://github.com/pytest-dev/pytest/issues/2642>`_)
  1515. - Stop vendoring ``pluggy`` - we're missing out on its latest changes for not
  1516. much benefit (`#2719 <https://github.com/pytest-dev/pytest/issues/2719>`_)
  1517. - Internal refactor: simplify ascii string escaping by using the
  1518. backslashreplace error handler in newer Python 3 versions. (`#2734
  1519. <https://github.com/pytest-dev/pytest/issues/2734>`_)
  1520. - Remove unnecessary mark evaluator in unittest plugin (`#2767
  1521. <https://github.com/pytest-dev/pytest/issues/2767>`_)
  1522. - Calls to ``Metafunc.addcall`` now emit a deprecation warning. This function
  1523. is scheduled to be removed in ``pytest-4.0``. (`#2876
  1524. <https://github.com/pytest-dev/pytest/issues/2876>`_)
  1525. - Internal move of the parameterset extraction to a more maintainable place.
  1526. (`#2877 <https://github.com/pytest-dev/pytest/issues/2877>`_)
  1527. - Internal refactoring to simplify scope node lookup. (`#2910
  1528. <https://github.com/pytest-dev/pytest/issues/2910>`_)
  1529. - Configure ``pytest`` to prevent pip from installing pytest in unsupported
  1530. Python versions. (`#2922
  1531. <https://github.com/pytest-dev/pytest/issues/2922>`_)
  1532. pytest 3.2.5 (2017-11-15)
  1533. =========================
  1534. Bug Fixes
  1535. ---------
  1536. - Remove ``py<1.5`` restriction from ``pytest`` as this can cause version
  1537. conflicts in some installations. (`#2926
  1538. <https://github.com/pytest-dev/pytest/issues/2926>`_)
  1539. pytest 3.2.4 (2017-11-13)
  1540. =========================
  1541. Bug Fixes
  1542. ---------
  1543. - Fix the bug where running with ``--pyargs`` will result in items with
  1544. empty ``parent.nodeid`` if run from a different root directory. (`#2775
  1545. <https://github.com/pytest-dev/pytest/issues/2775>`_)
  1546. - Fix issue with ``@pytest.parametrize`` if argnames was specified as keyword arguments.
  1547. (`#2819 <https://github.com/pytest-dev/pytest/issues/2819>`_)
  1548. - Strip whitespace from marker names when reading them from INI config. (`#2856
  1549. <https://github.com/pytest-dev/pytest/issues/2856>`_)
  1550. - Show full context of doctest source in the pytest output, if the line number of
  1551. failed example in the docstring is < 9. (`#2882
  1552. <https://github.com/pytest-dev/pytest/issues/2882>`_)
  1553. - Match fixture paths against actual path segments in order to avoid matching folders which share a prefix.
  1554. (`#2836 <https://github.com/pytest-dev/pytest/issues/2836>`_)
  1555. Improved Documentation
  1556. ----------------------
  1557. - Introduce a dedicated section about conftest.py. (`#1505
  1558. <https://github.com/pytest-dev/pytest/issues/1505>`_)
  1559. - Explicitly mention ``xpass`` in the documentation of ``xfail``. (`#1997
  1560. <https://github.com/pytest-dev/pytest/issues/1997>`_)
  1561. - Append example for pytest.param in the example/parametrize document. (`#2658
  1562. <https://github.com/pytest-dev/pytest/issues/2658>`_)
  1563. - Clarify language of proposal for fixtures parameters (`#2893
  1564. <https://github.com/pytest-dev/pytest/issues/2893>`_)
  1565. - List python 3.6 in the documented supported versions in the getting started
  1566. document. (`#2903 <https://github.com/pytest-dev/pytest/issues/2903>`_)
  1567. - Clarify the documentation of available fixture scopes. (`#538
  1568. <https://github.com/pytest-dev/pytest/issues/538>`_)
  1569. - Add documentation about the ``python -m pytest`` invocation adding the
  1570. current directory to sys.path. (`#911
  1571. <https://github.com/pytest-dev/pytest/issues/911>`_)
  1572. pytest 3.2.3 (2017-10-03)
  1573. =========================
  1574. Bug Fixes
  1575. ---------
  1576. - Fix crash in tab completion when no prefix is given. (`#2748
  1577. <https://github.com/pytest-dev/pytest/issues/2748>`_)
  1578. - The equality checking function (``__eq__``) of ``MarkDecorator`` returns
  1579. ``False`` if one object is not an instance of ``MarkDecorator``. (`#2758
  1580. <https://github.com/pytest-dev/pytest/issues/2758>`_)
  1581. - When running ``pytest --fixtures-per-test``: don't crash if an item has no
  1582. _fixtureinfo attribute (e.g. doctests) (`#2788
  1583. <https://github.com/pytest-dev/pytest/issues/2788>`_)
  1584. Improved Documentation
  1585. ----------------------
  1586. - In help text of ``-k`` option, add example of using ``not`` to not select
  1587. certain tests whose names match the provided expression. (`#1442
  1588. <https://github.com/pytest-dev/pytest/issues/1442>`_)
  1589. - Add note in ``parametrize.rst`` about calling ``metafunc.parametrize``
  1590. multiple times. (`#1548 <https://github.com/pytest-dev/pytest/issues/1548>`_)
  1591. Trivial/Internal Changes
  1592. ------------------------
  1593. - Set ``xfail_strict=True`` in pytest's own test suite to catch expected
  1594. failures as soon as they start to pass. (`#2722
  1595. <https://github.com/pytest-dev/pytest/issues/2722>`_)
  1596. - Fix typo in example of passing a callable to markers (in example/markers.rst)
  1597. (`#2765 <https://github.com/pytest-dev/pytest/issues/2765>`_)
  1598. pytest 3.2.2 (2017-09-06)
  1599. =========================
  1600. Bug Fixes
  1601. ---------
  1602. - Calling the deprecated ``request.getfuncargvalue()`` now shows the source of
  1603. the call. (`#2681 <https://github.com/pytest-dev/pytest/issues/2681>`_)
  1604. - Allow tests declared as ``@staticmethod`` to use fixtures. (`#2699
  1605. <https://github.com/pytest-dev/pytest/issues/2699>`_)
  1606. - Fixed edge-case during collection: attributes which raised ``pytest.fail``
  1607. when accessed would abort the entire collection. (`#2707
  1608. <https://github.com/pytest-dev/pytest/issues/2707>`_)
  1609. - Fix ``ReprFuncArgs`` with mixed unicode and UTF-8 args. (`#2731
  1610. <https://github.com/pytest-dev/pytest/issues/2731>`_)
  1611. Improved Documentation
  1612. ----------------------
  1613. - In examples on working with custom markers, add examples demonstrating the
  1614. usage of ``pytest.mark.MARKER_NAME.with_args`` in comparison with
  1615. ``pytest.mark.MARKER_NAME.__call__`` (`#2604
  1616. <https://github.com/pytest-dev/pytest/issues/2604>`_)
  1617. - In one of the simple examples, use ``pytest_collection_modifyitems()`` to skip
  1618. tests based on a command-line option, allowing its sharing while preventing a
  1619. user error when acessing ``pytest.config`` before the argument parsing.
  1620. (`#2653 <https://github.com/pytest-dev/pytest/issues/2653>`_)
  1621. Trivial/Internal Changes
  1622. ------------------------
  1623. - Fixed minor error in 'Good Practices/Manual Integration' code snippet.
  1624. (`#2691 <https://github.com/pytest-dev/pytest/issues/2691>`_)
  1625. - Fixed typo in goodpractices.rst. (`#2721
  1626. <https://github.com/pytest-dev/pytest/issues/2721>`_)
  1627. - Improve user guidance regarding ``--resultlog`` deprecation. (`#2739
  1628. <https://github.com/pytest-dev/pytest/issues/2739>`_)
  1629. pytest 3.2.1 (2017-08-08)
  1630. =========================
  1631. Bug Fixes
  1632. ---------
  1633. - Fixed small terminal glitch when collecting a single test item. (`#2579
  1634. <https://github.com/pytest-dev/pytest/issues/2579>`_)
  1635. - Correctly consider ``/`` as the file separator to automatically mark plugin
  1636. files for rewrite on Windows. (`#2591 <https://github.com/pytest-
  1637. dev/pytest/issues/2591>`_)
  1638. - Properly escape test names when setting ``PYTEST_CURRENT_TEST`` environment
  1639. variable. (`#2644 <https://github.com/pytest-dev/pytest/issues/2644>`_)
  1640. - Fix error on Windows and Python 3.6+ when ``sys.stdout`` has been replaced
  1641. with a stream-like object which does not implement the full ``io`` module
  1642. buffer protocol. In particular this affects ``pytest-xdist`` users on the
  1643. aforementioned platform. (`#2666 <https://github.com/pytest-
  1644. dev/pytest/issues/2666>`_)
  1645. Improved Documentation
  1646. ----------------------
  1647. - Explicitly document which pytest features work with ``unittest``. (`#2626
  1648. <https://github.com/pytest-dev/pytest/issues/2626>`_)
  1649. pytest 3.2.0 (2017-07-30)
  1650. =========================
  1651. Deprecations and Removals
  1652. -------------------------
  1653. - ``pytest.approx`` no longer supports ``>``, ``>=``, ``<`` and ``<=``
  1654. operators to avoid surprising/inconsistent behavior. See `the approx docs
  1655. <https://docs.pytest.org/en/latest/builtin.html#pytest.approx>`_ for more
  1656. information. (`#2003 <https://github.com/pytest-dev/pytest/issues/2003>`_)
  1657. - All old-style specific behavior in current classes in the pytest's API is
  1658. considered deprecated at this point and will be removed in a future release.
  1659. This affects Python 2 users only and in rare situations. (`#2147
  1660. <https://github.com/pytest-dev/pytest/issues/2147>`_)
  1661. - A deprecation warning is now raised when using marks for parameters
  1662. in ``pytest.mark.parametrize``. Use ``pytest.param`` to apply marks to
  1663. parameters instead. (`#2427 <https://github.com/pytest-dev/pytest/issues/2427>`_)
  1664. Features
  1665. --------
  1666. - Add support for numpy arrays (and dicts) to approx. (`#1994
  1667. <https://github.com/pytest-dev/pytest/issues/1994>`_)
  1668. - Now test function objects have a ``pytestmark`` attribute containing a list
  1669. of marks applied directly to the test function, as opposed to marks inherited
  1670. from parent classes or modules. (`#2516 <https://github.com/pytest-
  1671. dev/pytest/issues/2516>`_)
  1672. - Collection ignores local virtualenvs by default; ``--collect-in-virtualenv``
  1673. overrides this behavior. (`#2518 <https://github.com/pytest-
  1674. dev/pytest/issues/2518>`_)
  1675. - Allow class methods decorated as ``@staticmethod`` to be candidates for
  1676. collection as a test function. (Only for Python 2.7 and above. Python 2.6
  1677. will still ignore static methods.) (`#2528 <https://github.com/pytest-
  1678. dev/pytest/issues/2528>`_)
  1679. - Introduce ``mark.with_args`` in order to allow passing functions/classes as
  1680. sole argument to marks. (`#2540 <https://github.com/pytest-
  1681. dev/pytest/issues/2540>`_)
  1682. - New ``cache_dir`` ini option: sets the directory where the contents of the
  1683. cache plugin are stored. Directory may be relative or absolute path: if relative path, then
  1684. directory is created relative to ``rootdir``, otherwise it is used as is.
  1685. Additionally path may contain environment variables which are expanded during
  1686. runtime. (`#2543 <https://github.com/pytest-dev/pytest/issues/2543>`_)
  1687. - Introduce the ``PYTEST_CURRENT_TEST`` environment variable that is set with
  1688. the ``nodeid`` and stage (``setup``, ``call`` and ``teardown``) of the test
  1689. being currently executed. See the `documentation
  1690. <https://docs.pytest.org/en/latest/example/simple.html#pytest-current-test-
  1691. environment-variable>`_ for more info. (`#2583 <https://github.com/pytest-
  1692. dev/pytest/issues/2583>`_)
  1693. - Introduced ``@pytest.mark.filterwarnings`` mark which allows overwriting the
  1694. warnings filter on a per test, class or module level. See the `docs
  1695. <https://docs.pytest.org/en/latest/warnings.html#pytest-mark-
  1696. filterwarnings>`_ for more information. (`#2598 <https://github.com/pytest-
  1697. dev/pytest/issues/2598>`_)
  1698. - ``--last-failed`` now remembers forever when a test has failed and only
  1699. forgets it if it passes again. This makes it easy to fix a test suite by
  1700. selectively running files and fixing tests incrementally. (`#2621
  1701. <https://github.com/pytest-dev/pytest/issues/2621>`_)
  1702. - New ``pytest_report_collectionfinish`` hook which allows plugins to add
  1703. messages to the terminal reporting after collection has been finished
  1704. successfully. (`#2622 <https://github.com/pytest-dev/pytest/issues/2622>`_)
  1705. - Added support for `PEP-415's <https://www.python.org/dev/peps/pep-0415/>`_
  1706. ``Exception.__suppress_context__``. Now if a ``raise exception from None`` is
  1707. caught by pytest, pytest will no longer chain the context in the test report.
  1708. The behavior now matches Python's traceback behavior. (`#2631
  1709. <https://github.com/pytest-dev/pytest/issues/2631>`_)
  1710. - Exceptions raised by ``pytest.fail``, ``pytest.skip`` and ``pytest.xfail``
  1711. now subclass BaseException, making them harder to be caught unintentionally
  1712. by normal code. (`#580 <https://github.com/pytest-dev/pytest/issues/580>`_)
  1713. Bug Fixes
  1714. ---------
  1715. - Set ``stdin`` to a closed ``PIPE`` in ``pytester.py.Testdir.popen()`` for
  1716. avoid unwanted interactive ``pdb`` (`#2023 <https://github.com/pytest-
  1717. dev/pytest/issues/2023>`_)
  1718. - Add missing ``encoding`` attribute to ``sys.std*`` streams when using
  1719. ``capsys`` capture mode. (`#2375 <https://github.com/pytest-
  1720. dev/pytest/issues/2375>`_)
  1721. - Fix terminal color changing to black on Windows if ``colorama`` is imported
  1722. in a ``conftest.py`` file. (`#2510 <https://github.com/pytest-
  1723. dev/pytest/issues/2510>`_)
  1724. - Fix line number when reporting summary of skipped tests. (`#2548
  1725. <https://github.com/pytest-dev/pytest/issues/2548>`_)
  1726. - capture: ensure that EncodedFile.name is a string. (`#2555
  1727. <https://github.com/pytest-dev/pytest/issues/2555>`_)
  1728. - The options ``--fixtures`` and ``--fixtures-per-test`` will now keep
  1729. indentation within docstrings. (`#2574 <https://github.com/pytest-
  1730. dev/pytest/issues/2574>`_)
  1731. - doctests line numbers are now reported correctly, fixing `pytest-sugar#122
  1732. <https://github.com/Frozenball/pytest-sugar/issues/122>`_. (`#2610
  1733. <https://github.com/pytest-dev/pytest/issues/2610>`_)
  1734. - Fix non-determinism in order of fixture collection. Adds new dependency
  1735. (ordereddict) for Python 2.6. (`#920 <https://github.com/pytest-
  1736. dev/pytest/issues/920>`_)
  1737. Improved Documentation
  1738. ----------------------
  1739. - Clarify ``pytest_configure`` hook call order. (`#2539
  1740. <https://github.com/pytest-dev/pytest/issues/2539>`_)
  1741. - Extend documentation for testing plugin code with the ``pytester`` plugin.
  1742. (`#971 <https://github.com/pytest-dev/pytest/issues/971>`_)
  1743. Trivial/Internal Changes
  1744. ------------------------
  1745. - Update help message for ``--strict`` to make it clear it only deals with
  1746. unregistered markers, not warnings. (`#2444 <https://github.com/pytest-
  1747. dev/pytest/issues/2444>`_)
  1748. - Internal code move: move code for pytest.approx/pytest.raises to own files in
  1749. order to cut down the size of python.py (`#2489 <https://github.com/pytest-
  1750. dev/pytest/issues/2489>`_)
  1751. - Renamed the utility function ``_pytest.compat._escape_strings`` to
  1752. ``_ascii_escaped`` to better communicate the function's purpose. (`#2533
  1753. <https://github.com/pytest-dev/pytest/issues/2533>`_)
  1754. - Improve error message for CollectError with skip/skipif. (`#2546
  1755. <https://github.com/pytest-dev/pytest/issues/2546>`_)
  1756. - Emit warning about ``yield`` tests being deprecated only once per generator.
  1757. (`#2562 <https://github.com/pytest-dev/pytest/issues/2562>`_)
  1758. - Ensure final collected line doesn't include artifacts of previous write.
  1759. (`#2571 <https://github.com/pytest-dev/pytest/issues/2571>`_)
  1760. - Fixed all flake8 errors and warnings. (`#2581 <https://github.com/pytest-
  1761. dev/pytest/issues/2581>`_)
  1762. - Added ``fix-lint`` tox environment to run automatic pep8 fixes on the code.
  1763. (`#2582 <https://github.com/pytest-dev/pytest/issues/2582>`_)
  1764. - Turn warnings into errors in pytest's own test suite in order to catch
  1765. regressions due to deprecations more promptly. (`#2588
  1766. <https://github.com/pytest-dev/pytest/issues/2588>`_)
  1767. - Show multiple issue links in CHANGELOG entries. (`#2620
  1768. <https://github.com/pytest-dev/pytest/issues/2620>`_)
  1769. pytest 3.1.3 (2017-07-03)
  1770. =========================
  1771. Bug Fixes
  1772. ---------
  1773. - Fix decode error in Python 2 for doctests in docstrings. (`#2434
  1774. <https://github.com/pytest-dev/pytest/issues/2434>`_)
  1775. - Exceptions raised during teardown by finalizers are now suppressed until all
  1776. finalizers are called, with the initial exception reraised. (`#2440
  1777. <https://github.com/pytest-dev/pytest/issues/2440>`_)
  1778. - Fix incorrect "collected items" report when specifying tests on the command-
  1779. line. (`#2464 <https://github.com/pytest-dev/pytest/issues/2464>`_)
  1780. - ``deprecated_call`` in context-manager form now captures deprecation warnings
  1781. even if the same warning has already been raised. Also, ``deprecated_call``
  1782. will always produce the same error message (previously it would produce
  1783. different messages in context-manager vs. function-call mode). (`#2469
  1784. <https://github.com/pytest-dev/pytest/issues/2469>`_)
  1785. - Fix issue where paths collected by pytest could have triple leading ``/``
  1786. characters. (`#2475 <https://github.com/pytest-dev/pytest/issues/2475>`_)
  1787. - Fix internal error when trying to detect the start of a recursive traceback.
  1788. (`#2486 <https://github.com/pytest-dev/pytest/issues/2486>`_)
  1789. Improved Documentation
  1790. ----------------------
  1791. - Explicitly state for which hooks the calls stop after the first non-None
  1792. result. (`#2493 <https://github.com/pytest-dev/pytest/issues/2493>`_)
  1793. Trivial/Internal Changes
  1794. ------------------------
  1795. - Create invoke tasks for updating the vendored packages. (`#2474
  1796. <https://github.com/pytest-dev/pytest/issues/2474>`_)
  1797. - Update copyright dates in LICENSE, README.rst and in the documentation.
  1798. (`#2499 <https://github.com/pytest-dev/pytest/issues/2499>`_)
  1799. pytest 3.1.2 (2017-06-08)
  1800. =========================
  1801. Bug Fixes
  1802. ---------
  1803. - Required options added via ``pytest_addoption`` will no longer prevent using
  1804. --help without passing them. (#1999)
  1805. - Respect ``python_files`` in assertion rewriting. (#2121)
  1806. - Fix recursion error detection when frames in the traceback contain objects
  1807. that can't be compared (like ``numpy`` arrays). (#2459)
  1808. - ``UnicodeWarning`` is issued from the internal pytest warnings plugin only
  1809. when the message contains non-ascii unicode (Python 2 only). (#2463)
  1810. - Added a workaround for Python 3.6 ``WindowsConsoleIO`` breaking due to Pytests's
  1811. ``FDCapture``. Other code using console handles might still be affected by the
  1812. very same issue and might require further workarounds/fixes, i.e. ``colorama``.
  1813. (#2467)
  1814. Improved Documentation
  1815. ----------------------
  1816. - Fix internal API links to ``pluggy`` objects. (#2331)
  1817. - Make it clear that ``pytest.xfail`` stops test execution at the calling point
  1818. and improve overall flow of the ``skipping`` docs. (#810)
  1819. pytest 3.1.1 (2017-05-30)
  1820. =========================
  1821. Bug Fixes
  1822. ---------
  1823. - pytest warning capture no longer overrides existing warning filters. The
  1824. previous behaviour would override all filters and caused regressions in test
  1825. suites which configure warning filters to match their needs. Note that as a
  1826. side-effect of this is that ``DeprecationWarning`` and
  1827. ``PendingDeprecationWarning`` are no longer shown by default. (#2430)
  1828. - Fix issue with non-ascii contents in doctest text files. (#2434)
  1829. - Fix encoding errors for unicode warnings in Python 2. (#2436)
  1830. - ``pytest.deprecated_call`` now captures ``PendingDeprecationWarning`` in
  1831. context manager form. (#2441)
  1832. Improved Documentation
  1833. ----------------------
  1834. - Addition of towncrier for changelog management. (#2390)
  1835. 3.1.0 (2017-05-22)
  1836. ==================
  1837. New Features
  1838. ------------
  1839. * The ``pytest-warnings`` plugin has been integrated into the core and now ``pytest`` automatically
  1840. captures and displays warnings at the end of the test session.
  1841. .. warning::
  1842. This feature may disrupt test suites which apply and treat warnings themselves, and can be
  1843. disabled in your ``pytest.ini``:
  1844. .. code-block:: ini
  1845. [pytest]
  1846. addopts = -p no:warnings
  1847. See the `warnings documentation page <https://docs.pytest.org/en/latest/warnings.html>`_ for more
  1848. information.
  1849. Thanks `@nicoddemus`_ for the PR.
  1850. * Added ``junit_suite_name`` ini option to specify root ``<testsuite>`` name for JUnit XML reports (`#533`_).
  1851. * Added an ini option ``doctest_encoding`` to specify which encoding to use for doctest files.
  1852. Thanks `@wheerd`_ for the PR (`#2101`_).
  1853. * ``pytest.warns`` now checks for subclass relationship rather than
  1854. class equality. Thanks `@lesteve`_ for the PR (`#2166`_)
  1855. * ``pytest.raises`` now asserts that the error message matches a text or regex
  1856. with the ``match`` keyword argument. Thanks `@Kriechi`_ for the PR.
  1857. * ``pytest.param`` can be used to declare test parameter sets with marks and test ids.
  1858. Thanks `@RonnyPfannschmidt`_ for the PR.
  1859. Changes
  1860. -------
  1861. * remove all internal uses of pytest_namespace hooks,
  1862. this is to prepare the removal of preloadconfig in pytest 4.0
  1863. Thanks to `@RonnyPfannschmidt`_ for the PR.
  1864. * pytest now warns when a callable ids raises in a parametrized test. Thanks `@fogo`_ for the PR.
  1865. * It is now possible to skip test classes from being collected by setting a
  1866. ``__test__`` attribute to ``False`` in the class body (`#2007`_). Thanks
  1867. to `@syre`_ for the report and `@lwm`_ for the PR.
  1868. * Change junitxml.py to produce reports that comply with Junitxml schema.
  1869. If the same test fails with failure in call and then errors in teardown
  1870. we split testcase element into two, one containing the error and the other
  1871. the failure. (`#2228`_) Thanks to `@kkoukiou`_ for the PR.
  1872. * Testcase reports with a ``url`` attribute will now properly write this to junitxml.
  1873. Thanks `@fushi`_ for the PR (`#1874`_).
  1874. * Remove common items from dict comparison output when verbosity=1. Also update
  1875. the truncation message to make it clearer that pytest truncates all
  1876. assertion messages if verbosity < 2 (`#1512`_).
  1877. Thanks `@mattduck`_ for the PR
  1878. * ``--pdbcls`` no longer implies ``--pdb``. This makes it possible to use
  1879. ``addopts=--pdbcls=module.SomeClass`` on ``pytest.ini``. Thanks `@davidszotten`_ for
  1880. the PR (`#1952`_).
  1881. * fix `#2013`_: turn RecordedWarning into ``namedtuple``,
  1882. to give it a comprehensible repr while preventing unwarranted modification.
  1883. * fix `#2208`_: ensure an iteration limit for _pytest.compat.get_real_func.
  1884. Thanks `@RonnyPfannschmidt`_ for the report and PR.
  1885. * Hooks are now verified after collection is complete, rather than right after loading installed plugins. This
  1886. makes it easy to write hooks for plugins which will be loaded during collection, for example using the
  1887. ``pytest_plugins`` special variable (`#1821`_).
  1888. Thanks `@nicoddemus`_ for the PR.
  1889. * Modify ``pytest_make_parametrize_id()`` hook to accept ``argname`` as an
  1890. additional parameter.
  1891. Thanks `@unsignedint`_ for the PR.
  1892. * Add ``venv`` to the default ``norecursedirs`` setting.
  1893. Thanks `@The-Compiler`_ for the PR.
  1894. * ``PluginManager.import_plugin`` now accepts unicode plugin names in Python 2.
  1895. Thanks `@reutsharabani`_ for the PR.
  1896. * fix `#2308`_: When using both ``--lf`` and ``--ff``, only the last failed tests are run.
  1897. Thanks `@ojii`_ for the PR.
  1898. * Replace minor/patch level version numbers in the documentation with placeholders.
  1899. This significantly reduces change-noise as different contributors regnerate
  1900. the documentation on different platforms.
  1901. Thanks `@RonnyPfannschmidt`_ for the PR.
  1902. * fix `#2391`_: consider pytest_plugins on all plugin modules
  1903. Thanks `@RonnyPfannschmidt`_ for the PR.
  1904. Bug Fixes
  1905. ---------
  1906. * Fix ``AttributeError`` on ``sys.stdout.buffer`` / ``sys.stderr.buffer``
  1907. while using ``capsys`` fixture in python 3. (`#1407`_).
  1908. Thanks to `@asottile`_.
  1909. * Change capture.py's ``DontReadFromInput`` class to throw ``io.UnsupportedOperation`` errors rather
  1910. than ValueErrors in the ``fileno`` method (`#2276`_).
  1911. Thanks `@metasyn`_ and `@vlad-dragos`_ for the PR.
  1912. * Fix exception formatting while importing modules when the exception message
  1913. contains non-ascii characters (`#2336`_).
  1914. Thanks `@fabioz`_ for the report and `@nicoddemus`_ for the PR.
  1915. * Added documentation related to issue (`#1937`_)
  1916. Thanks `@skylarjhdownes`_ for the PR.
  1917. * Allow collecting files with any file extension as Python modules (`#2369`_).
  1918. Thanks `@Kodiologist`_ for the PR.
  1919. * Show the correct error message when collect "parametrize" func with wrong args (`#2383`_).
  1920. Thanks `@The-Compiler`_ for the report and `@robin0371`_ for the PR.
  1921. .. _@davidszotten: https://github.com/davidszotten
  1922. .. _@fabioz: https://github.com/fabioz
  1923. .. _@fogo: https://github.com/fogo
  1924. .. _@fushi: https://github.com/fushi
  1925. .. _@Kodiologist: https://github.com/Kodiologist
  1926. .. _@Kriechi: https://github.com/Kriechi
  1927. .. _@mandeep: https://github.com/mandeep
  1928. .. _@mattduck: https://github.com/mattduck
  1929. .. _@metasyn: https://github.com/metasyn
  1930. .. _@MichalTHEDUDE: https://github.com/MichalTHEDUDE
  1931. .. _@ojii: https://github.com/ojii
  1932. .. _@reutsharabani: https://github.com/reutsharabani
  1933. .. _@robin0371: https://github.com/robin0371
  1934. .. _@skylarjhdownes: https://github.com/skylarjhdownes
  1935. .. _@unsignedint: https://github.com/unsignedint
  1936. .. _@wheerd: https://github.com/wheerd
  1937. .. _#1407: https://github.com/pytest-dev/pytest/issues/1407
  1938. .. _#1512: https://github.com/pytest-dev/pytest/issues/1512
  1939. .. _#1821: https://github.com/pytest-dev/pytest/issues/1821
  1940. .. _#1874: https://github.com/pytest-dev/pytest/pull/1874
  1941. .. _#1937: https://github.com/pytest-dev/pytest/issues/1937
  1942. .. _#1952: https://github.com/pytest-dev/pytest/pull/1952
  1943. .. _#2007: https://github.com/pytest-dev/pytest/issues/2007
  1944. .. _#2013: https://github.com/pytest-dev/pytest/issues/2013
  1945. .. _#2101: https://github.com/pytest-dev/pytest/pull/2101
  1946. .. _#2166: https://github.com/pytest-dev/pytest/pull/2166
  1947. .. _#2208: https://github.com/pytest-dev/pytest/issues/2208
  1948. .. _#2228: https://github.com/pytest-dev/pytest/issues/2228
  1949. .. _#2276: https://github.com/pytest-dev/pytest/issues/2276
  1950. .. _#2308: https://github.com/pytest-dev/pytest/issues/2308
  1951. .. _#2336: https://github.com/pytest-dev/pytest/issues/2336
  1952. .. _#2369: https://github.com/pytest-dev/pytest/issues/2369
  1953. .. _#2383: https://github.com/pytest-dev/pytest/issues/2383
  1954. .. _#2391: https://github.com/pytest-dev/pytest/issues/2391
  1955. .. _#533: https://github.com/pytest-dev/pytest/issues/533
  1956. 3.0.7 (2017-03-14)
  1957. ==================
  1958. * Fix issue in assertion rewriting breaking due to modules silently discarding
  1959. other modules when importing fails
  1960. Notably, importing the ``anydbm`` module is fixed. (`#2248`_).
  1961. Thanks `@pfhayes`_ for the PR.
  1962. * junitxml: Fix problematic case where system-out tag occurred twice per testcase
  1963. element in the XML report. Thanks `@kkoukiou`_ for the PR.
  1964. * Fix regression, pytest now skips unittest correctly if run with ``--pdb``
  1965. (`#2137`_). Thanks to `@gst`_ for the report and `@mbyt`_ for the PR.
  1966. * Ignore exceptions raised from descriptors (e.g. properties) during Python test collection (`#2234`_).
  1967. Thanks to `@bluetech`_.
  1968. * ``--override-ini`` now correctly overrides some fundamental options like ``python_files`` (`#2238`_).
  1969. Thanks `@sirex`_ for the report and `@nicoddemus`_ for the PR.
  1970. * Replace ``raise StopIteration`` usages in the code by simple ``returns`` to finish generators, in accordance to `PEP-479`_ (`#2160`_).
  1971. Thanks `@tgoodlet`_ for the report and `@nicoddemus`_ for the PR.
  1972. * Fix internal errors when an unprintable ``AssertionError`` is raised inside a test.
  1973. Thanks `@omerhadari`_ for the PR.
  1974. * Skipping plugin now also works with test items generated by custom collectors (`#2231`_).
  1975. Thanks to `@vidartf`_.
  1976. * Fix trailing whitespace in console output if no .ini file presented (`#2281`_). Thanks `@fbjorn`_ for the PR.
  1977. * Conditionless ``xfail`` markers no longer rely on the underlying test item
  1978. being an instance of ``PyobjMixin``, and can therefore apply to tests not
  1979. collected by the built-in python test collector. Thanks `@barneygale`_ for the
  1980. PR.
  1981. .. _@pfhayes: https://github.com/pfhayes
  1982. .. _@bluetech: https://github.com/bluetech
  1983. .. _@gst: https://github.com/gst
  1984. .. _@sirex: https://github.com/sirex
  1985. .. _@vidartf: https://github.com/vidartf
  1986. .. _@kkoukiou: https://github.com/KKoukiou
  1987. .. _@omerhadari: https://github.com/omerhadari
  1988. .. _@fbjorn: https://github.com/fbjorn
  1989. .. _#2248: https://github.com/pytest-dev/pytest/issues/2248
  1990. .. _#2137: https://github.com/pytest-dev/pytest/issues/2137
  1991. .. _#2160: https://github.com/pytest-dev/pytest/issues/2160
  1992. .. _#2231: https://github.com/pytest-dev/pytest/issues/2231
  1993. .. _#2234: https://github.com/pytest-dev/pytest/issues/2234
  1994. .. _#2238: https://github.com/pytest-dev/pytest/issues/2238
  1995. .. _#2281: https://github.com/pytest-dev/pytest/issues/2281
  1996. .. _PEP-479: https://www.python.org/dev/peps/pep-0479/
  1997. 3.0.6 (2017-01-22)
  1998. ==================
  1999. * pytest no longer generates ``PendingDeprecationWarning`` from its own operations, which was introduced by mistake in version ``3.0.5`` (`#2118`_).
  2000. Thanks to `@nicoddemus`_ for the report and `@RonnyPfannschmidt`_ for the PR.
  2001. * pytest no longer recognizes coroutine functions as yield tests (`#2129`_).
  2002. Thanks to `@malinoff`_ for the PR.
  2003. * Plugins loaded by the ``PYTEST_PLUGINS`` environment variable are now automatically
  2004. considered for assertion rewriting (`#2185`_).
  2005. Thanks `@nicoddemus`_ for the PR.
  2006. * Improve error message when pytest.warns fails (`#2150`_). The type(s) of the
  2007. expected warnings and the list of caught warnings is added to the
  2008. error message. Thanks `@lesteve`_ for the PR.
  2009. * Fix ``pytester`` internal plugin to work correctly with latest versions of
  2010. ``zope.interface`` (`#1989`_). Thanks `@nicoddemus`_ for the PR.
  2011. * Assert statements of the ``pytester`` plugin again benefit from assertion rewriting (`#1920`_).
  2012. Thanks `@RonnyPfannschmidt`_ for the report and `@nicoddemus`_ for the PR.
  2013. * Specifying tests with colons like ``test_foo.py::test_bar`` for tests in
  2014. subdirectories with ini configuration files now uses the correct ini file
  2015. (`#2148`_). Thanks `@pelme`_.
  2016. * Fail ``testdir.runpytest().assert_outcomes()`` explicitly if the pytest
  2017. terminal output it relies on is missing. Thanks to `@eli-b`_ for the PR.
  2018. .. _@barneygale: https://github.com/barneygale
  2019. .. _@lesteve: https://github.com/lesteve
  2020. .. _@malinoff: https://github.com/malinoff
  2021. .. _@pelme: https://github.com/pelme
  2022. .. _@eli-b: https://github.com/eli-b
  2023. .. _#2118: https://github.com/pytest-dev/pytest/issues/2118
  2024. .. _#1989: https://github.com/pytest-dev/pytest/issues/1989
  2025. .. _#1920: https://github.com/pytest-dev/pytest/issues/1920
  2026. .. _#2129: https://github.com/pytest-dev/pytest/issues/2129
  2027. .. _#2148: https://github.com/pytest-dev/pytest/issues/2148
  2028. .. _#2150: https://github.com/pytest-dev/pytest/issues/2150
  2029. .. _#2185: https://github.com/pytest-dev/pytest/issues/2185
  2030. 3.0.5 (2016-12-05)
  2031. ==================
  2032. * Add warning when not passing ``option=value`` correctly to ``-o/--override-ini`` (`#2105`_).
  2033. Also improved the help documentation. Thanks to `@mbukatov`_ for the report and
  2034. `@lwm`_ for the PR.
  2035. * Now ``--confcutdir`` and ``--junit-xml`` are properly validated if they are directories
  2036. and filenames, respectively (`#2089`_ and `#2078`_). Thanks to `@lwm`_ for the PR.
  2037. * Add hint to error message hinting possible missing ``__init__.py`` (`#478`_). Thanks `@DuncanBetts`_.
  2038. * More accurately describe when fixture finalization occurs in documentation (`#687`_). Thanks `@DuncanBetts`_.
  2039. * Provide ``:ref:`` targets for ``recwarn.rst`` so we can use intersphinx referencing.
  2040. Thanks to `@dupuy`_ for the report and `@lwm`_ for the PR.
  2041. * In Python 2, use a simple ``+-`` ASCII string in the string representation of ``pytest.approx`` (for example ``"4 +- 4.0e-06"``)
  2042. because it is brittle to handle that in different contexts and representations internally in pytest
  2043. which can result in bugs such as `#2111`_. In Python 3, the representation still uses ``±`` (for example ``4 ± 4.0e-06``).
  2044. Thanks `@kerrick-lyft`_ for the report and `@nicoddemus`_ for the PR.
  2045. * Using ``item.Function``, ``item.Module``, etc., is now issuing deprecation warnings, prefer
  2046. ``pytest.Function``, ``pytest.Module``, etc., instead (`#2034`_).
  2047. Thanks `@nmundar`_ for the PR.
  2048. * Fix error message using ``approx`` with complex numbers (`#2082`_).
  2049. Thanks `@adler-j`_ for the report and `@nicoddemus`_ for the PR.
  2050. * Fixed false-positives warnings from assertion rewrite hook for modules imported more than
  2051. once by the ``pytest_plugins`` mechanism.
  2052. Thanks `@nicoddemus`_ for the PR.
  2053. * Remove an internal cache which could cause hooks from ``conftest.py`` files in
  2054. sub-directories to be called in other directories incorrectly (`#2016`_).
  2055. Thanks `@d-b-w`_ for the report and `@nicoddemus`_ for the PR.
  2056. * Remove internal code meant to support earlier Python 3 versions that produced the side effect
  2057. of leaving ``None`` in ``sys.modules`` when expressions were evaluated by pytest (for example passing a condition
  2058. as a string to ``pytest.mark.skipif``)(`#2103`_).
  2059. Thanks `@jaraco`_ for the report and `@nicoddemus`_ for the PR.
  2060. * Cope gracefully with a .pyc file with no matching .py file (`#2038`_). Thanks
  2061. `@nedbat`_.
  2062. .. _@syre: https://github.com/syre
  2063. .. _@adler-j: https://github.com/adler-j
  2064. .. _@d-b-w: https://bitbucket.org/d-b-w/
  2065. .. _@DuncanBetts: https://github.com/DuncanBetts
  2066. .. _@dupuy: https://bitbucket.org/dupuy/
  2067. .. _@kerrick-lyft: https://github.com/kerrick-lyft
  2068. .. _@lwm: https://github.com/lwm
  2069. .. _@mbukatov: https://github.com/mbukatov
  2070. .. _@nedbat: https://github.com/nedbat
  2071. .. _@nmundar: https://github.com/nmundar
  2072. .. _#2016: https://github.com/pytest-dev/pytest/issues/2016
  2073. .. _#2034: https://github.com/pytest-dev/pytest/issues/2034
  2074. .. _#2038: https://github.com/pytest-dev/pytest/issues/2038
  2075. .. _#2078: https://github.com/pytest-dev/pytest/issues/2078
  2076. .. _#2082: https://github.com/pytest-dev/pytest/issues/2082
  2077. .. _#2089: https://github.com/pytest-dev/pytest/issues/2089
  2078. .. _#2103: https://github.com/pytest-dev/pytest/issues/2103
  2079. .. _#2105: https://github.com/pytest-dev/pytest/issues/2105
  2080. .. _#2111: https://github.com/pytest-dev/pytest/issues/2111
  2081. .. _#478: https://github.com/pytest-dev/pytest/issues/478
  2082. .. _#687: https://github.com/pytest-dev/pytest/issues/687
  2083. 3.0.4 (2016-11-09)
  2084. ==================
  2085. * Import errors when collecting test modules now display the full traceback (`#1976`_).
  2086. Thanks `@cwitty`_ for the report and `@nicoddemus`_ for the PR.
  2087. * Fix confusing command-line help message for custom options with two or more ``metavar`` properties (`#2004`_).
  2088. Thanks `@okulynyak`_ and `@davehunt`_ for the report and `@nicoddemus`_ for the PR.
  2089. * When loading plugins, import errors which contain non-ascii messages are now properly handled in Python 2 (`#1998`_).
  2090. Thanks `@nicoddemus`_ for the PR.
  2091. * Fixed cyclic reference when ``pytest.raises`` is used in context-manager form (`#1965`_). Also as a
  2092. result of this fix, ``sys.exc_info()`` is left empty in both context-manager and function call usages.
  2093. Previously, ``sys.exc_info`` would contain the exception caught by the context manager,
  2094. even when the expected exception occurred.
  2095. Thanks `@MSeifert04`_ for the report and the PR.
  2096. * Fixed false-positives warnings from assertion rewrite hook for modules that were rewritten but
  2097. were later marked explicitly by ``pytest.register_assert_rewrite``
  2098. or implicitly as a plugin (`#2005`_).
  2099. Thanks `@RonnyPfannschmidt`_ for the report and `@nicoddemus`_ for the PR.
  2100. * Report teardown output on test failure (`#442`_).
  2101. Thanks `@matclab`_ for the PR.
  2102. * Fix teardown error message in generated xUnit XML.
  2103. Thanks `@gdyuldin`_ for the PR.
  2104. * Properly handle exceptions in ``multiprocessing`` tasks (`#1984`_).
  2105. Thanks `@adborden`_ for the report and `@nicoddemus`_ for the PR.
  2106. * Clean up unittest TestCase objects after tests are complete (`#1649`_).
  2107. Thanks `@d_b_w`_ for the report and PR.
  2108. .. _@adborden: https://github.com/adborden
  2109. .. _@cwitty: https://github.com/cwitty
  2110. .. _@d_b_w: https://github.com/d_b_w
  2111. .. _@gdyuldin: https://github.com/gdyuldin
  2112. .. _@matclab: https://github.com/matclab
  2113. .. _@MSeifert04: https://github.com/MSeifert04
  2114. .. _@okulynyak: https://github.com/okulynyak
  2115. .. _#442: https://github.com/pytest-dev/pytest/issues/442
  2116. .. _#1965: https://github.com/pytest-dev/pytest/issues/1965
  2117. .. _#1976: https://github.com/pytest-dev/pytest/issues/1976
  2118. .. _#1984: https://github.com/pytest-dev/pytest/issues/1984
  2119. .. _#1998: https://github.com/pytest-dev/pytest/issues/1998
  2120. .. _#2004: https://github.com/pytest-dev/pytest/issues/2004
  2121. .. _#2005: https://github.com/pytest-dev/pytest/issues/2005
  2122. .. _#1649: https://github.com/pytest-dev/pytest/issues/1649
  2123. 3.0.3 (2016-09-28)
  2124. ==================
  2125. * The ``ids`` argument to ``parametrize`` again accepts ``unicode`` strings
  2126. in Python 2 (`#1905`_).
  2127. Thanks `@philpep`_ for the report and `@nicoddemus`_ for the PR.
  2128. * Assertions are now being rewritten for plugins in development mode
  2129. (``pip install -e``) (`#1934`_).
  2130. Thanks `@nicoddemus`_ for the PR.
  2131. * Fix pkg_resources import error in Jython projects (`#1853`_).
  2132. Thanks `@raquel-ucl`_ for the PR.
  2133. * Got rid of ``AttributeError: 'Module' object has no attribute '_obj'`` exception
  2134. in Python 3 (`#1944`_).
  2135. Thanks `@axil`_ for the PR.
  2136. * Explain a bad scope value passed to ``@fixture`` declarations or
  2137. a ``MetaFunc.parametrize()`` call. Thanks `@tgoodlet`_ for the PR.
  2138. * This version includes ``pluggy-0.4.0``, which correctly handles
  2139. ``VersionConflict`` errors in plugins (`#704`_).
  2140. Thanks `@nicoddemus`_ for the PR.
  2141. .. _@philpep: https://github.com/philpep
  2142. .. _@raquel-ucl: https://github.com/raquel-ucl
  2143. .. _@axil: https://github.com/axil
  2144. .. _@tgoodlet: https://github.com/tgoodlet
  2145. .. _@vlad-dragos: https://github.com/vlad-dragos
  2146. .. _#1853: https://github.com/pytest-dev/pytest/issues/1853
  2147. .. _#1905: https://github.com/pytest-dev/pytest/issues/1905
  2148. .. _#1934: https://github.com/pytest-dev/pytest/issues/1934
  2149. .. _#1944: https://github.com/pytest-dev/pytest/issues/1944
  2150. .. _#704: https://github.com/pytest-dev/pytest/issues/704
  2151. 3.0.2 (2016-09-01)
  2152. ==================
  2153. * Improve error message when passing non-string ids to ``pytest.mark.parametrize`` (`#1857`_).
  2154. Thanks `@okken`_ for the report and `@nicoddemus`_ for the PR.
  2155. * Add ``buffer`` attribute to stdin stub class ``pytest.capture.DontReadFromInput``
  2156. Thanks `@joguSD`_ for the PR.
  2157. * Fix ``UnicodeEncodeError`` when string comparison with unicode has failed. (`#1864`_)
  2158. Thanks `@AiOO`_ for the PR.
  2159. * ``pytest_plugins`` is now handled correctly if defined as a string (as opposed as
  2160. a sequence of strings) when modules are considered for assertion rewriting.
  2161. Due to this bug, much more modules were being rewritten than necessary
  2162. if a test suite uses ``pytest_plugins`` to load internal plugins (`#1888`_).
  2163. Thanks `@jaraco`_ for the report and `@nicoddemus`_ for the PR (`#1891`_).
  2164. * Do not call tearDown and cleanups when running tests from
  2165. ``unittest.TestCase`` subclasses with ``--pdb``
  2166. enabled. This allows proper post mortem debugging for all applications
  2167. which have significant logic in their tearDown machinery (`#1890`_). Thanks
  2168. `@mbyt`_ for the PR.
  2169. * Fix use of deprecated ``getfuncargvalue`` method in the internal doctest plugin.
  2170. Thanks `@ViviCoder`_ for the report (`#1898`_).
  2171. .. _@joguSD: https://github.com/joguSD
  2172. .. _@AiOO: https://github.com/AiOO
  2173. .. _@mbyt: https://github.com/mbyt
  2174. .. _@ViviCoder: https://github.com/ViviCoder
  2175. .. _#1857: https://github.com/pytest-dev/pytest/issues/1857
  2176. .. _#1864: https://github.com/pytest-dev/pytest/issues/1864
  2177. .. _#1888: https://github.com/pytest-dev/pytest/issues/1888
  2178. .. _#1891: https://github.com/pytest-dev/pytest/pull/1891
  2179. .. _#1890: https://github.com/pytest-dev/pytest/issues/1890
  2180. .. _#1898: https://github.com/pytest-dev/pytest/issues/1898
  2181. 3.0.1 (2016-08-23)
  2182. ==================
  2183. * Fix regression when ``importorskip`` is used at module level (`#1822`_).
  2184. Thanks `@jaraco`_ and `@The-Compiler`_ for the report and `@nicoddemus`_ for the PR.
  2185. * Fix parametrization scope when session fixtures are used in conjunction
  2186. with normal parameters in the same call (`#1832`_).
  2187. Thanks `@The-Compiler`_ for the report, `@Kingdread`_ and `@nicoddemus`_ for the PR.
  2188. * Fix internal error when parametrizing tests or fixtures using an empty ``ids`` argument (`#1849`_).
  2189. Thanks `@OPpuolitaival`_ for the report and `@nicoddemus`_ for the PR.
  2190. * Fix loader error when running ``pytest`` embedded in a zipfile.
  2191. Thanks `@mbachry`_ for the PR.
  2192. .. _@Kingdread: https://github.com/Kingdread
  2193. .. _@mbachry: https://github.com/mbachry
  2194. .. _@OPpuolitaival: https://github.com/OPpuolitaival
  2195. .. _#1822: https://github.com/pytest-dev/pytest/issues/1822
  2196. .. _#1832: https://github.com/pytest-dev/pytest/issues/1832
  2197. .. _#1849: https://github.com/pytest-dev/pytest/issues/1849
  2198. 3.0.0 (2016-08-18)
  2199. ==================
  2200. **Incompatible changes**
  2201. A number of incompatible changes were made in this release, with the intent of removing features deprecated for a long
  2202. time or change existing behaviors in order to make them less surprising/more useful.
  2203. * Reinterpretation mode has now been removed. Only plain and rewrite
  2204. mode are available, consequently the ``--assert=reinterp`` option is
  2205. no longer available. This also means files imported from plugins or
  2206. ``conftest.py`` will not benefit from improved assertions by
  2207. default, you should use ``pytest.register_assert_rewrite()`` to
  2208. explicitly turn on assertion rewriting for those files. Thanks
  2209. `@flub`_ for the PR.
  2210. * The following deprecated commandline options were removed:
  2211. * ``--genscript``: no longer supported;
  2212. * ``--no-assert``: use ``--assert=plain`` instead;
  2213. * ``--nomagic``: use ``--assert=plain`` instead;
  2214. * ``--report``: use ``-r`` instead;
  2215. Thanks to `@RedBeardCode`_ for the PR (`#1664`_).
  2216. * ImportErrors in plugins now are a fatal error instead of issuing a
  2217. pytest warning (`#1479`_). Thanks to `@The-Compiler`_ for the PR.
  2218. * Removed support code for Python 3 versions < 3.3 (`#1627`_).
  2219. * Removed all ``py.test-X*`` entry points. The versioned, suffixed entry points
  2220. were never documented and a leftover from a pre-virtualenv era. These entry
  2221. points also created broken entry points in wheels, so removing them also
  2222. removes a source of confusion for users (`#1632`_).
  2223. Thanks `@obestwalter`_ for the PR.
  2224. * ``pytest.skip()`` now raises an error when used to decorate a test function,
  2225. as opposed to its original intent (to imperatively skip a test inside a test function). Previously
  2226. this usage would cause the entire module to be skipped (`#607`_).
  2227. Thanks `@omarkohl`_ for the complete PR (`#1519`_).
  2228. * Exit tests if a collection error occurs. A poll indicated most users will hit CTRL-C
  2229. anyway as soon as they see collection errors, so pytest might as well make that the default behavior (`#1421`_).
  2230. A ``--continue-on-collection-errors`` option has been added to restore the previous behaviour.
  2231. Thanks `@olegpidsadnyi`_ and `@omarkohl`_ for the complete PR (`#1628`_).
  2232. * Renamed the pytest ``pdb`` module (plugin) into ``debugging`` to avoid clashes with the builtin ``pdb`` module.
  2233. * Raise a helpful failure message when requesting a parametrized fixture at runtime,
  2234. e.g. with ``request.getfixturevalue``. Previously these parameters were simply
  2235. never defined, so a fixture decorated like ``@pytest.fixture(params=[0, 1, 2])``
  2236. only ran once (`#460`_).
  2237. Thanks to `@nikratio`_ for the bug report, `@RedBeardCode`_ and `@tomviner`_ for the PR.
  2238. * ``_pytest.monkeypatch.monkeypatch`` class has been renamed to ``_pytest.monkeypatch.MonkeyPatch``
  2239. so it doesn't conflict with the ``monkeypatch`` fixture.
  2240. * ``--exitfirst / -x`` can now be overridden by a following ``--maxfail=N``
  2241. and is just a synonym for ``--maxfail=1``.
  2242. **New Features**
  2243. * Support nose-style ``__test__`` attribute on methods of classes,
  2244. including unittest-style Classes. If set to ``False``, the test will not be
  2245. collected.
  2246. * New ``doctest_namespace`` fixture for injecting names into the
  2247. namespace in which doctests run.
  2248. Thanks `@milliams`_ for the complete PR (`#1428`_).
  2249. * New ``--doctest-report`` option available to change the output format of diffs
  2250. when running (failing) doctests (implements `#1749`_).
  2251. Thanks `@hartym`_ for the PR.
  2252. * New ``name`` argument to ``pytest.fixture`` decorator which allows a custom name
  2253. for a fixture (to solve the funcarg-shadowing-fixture problem).
  2254. Thanks `@novas0x2a`_ for the complete PR (`#1444`_).
  2255. * New ``approx()`` function for easily comparing floating-point numbers in
  2256. tests.
  2257. Thanks `@kalekundert`_ for the complete PR (`#1441`_).
  2258. * Ability to add global properties in the final xunit output file by accessing
  2259. the internal ``junitxml`` plugin (experimental).
  2260. Thanks `@tareqalayan`_ for the complete PR `#1454`_).
  2261. * New ``ExceptionInfo.match()`` method to match a regular expression on the
  2262. string representation of an exception (`#372`_).
  2263. Thanks `@omarkohl`_ for the complete PR (`#1502`_).
  2264. * ``__tracebackhide__`` can now also be set to a callable which then can decide
  2265. whether to filter the traceback based on the ``ExceptionInfo`` object passed
  2266. to it. Thanks `@The-Compiler`_ for the complete PR (`#1526`_).
  2267. * New ``pytest_make_parametrize_id(config, val)`` hook which can be used by plugins to provide
  2268. friendly strings for custom types.
  2269. Thanks `@palaviv`_ for the PR.
  2270. * ``capsys`` and ``capfd`` now have a ``disabled()`` context-manager method, which
  2271. can be used to temporarily disable capture within a test.
  2272. Thanks `@nicoddemus`_ for the PR.
  2273. * New cli flag ``--fixtures-per-test``: shows which fixtures are being used
  2274. for each selected test item. Features doc strings of fixtures by default.
  2275. Can also show where fixtures are defined if combined with ``-v``.
  2276. Thanks `@hackebrot`_ for the PR.
  2277. * Introduce ``pytest`` command as recommended entry point. Note that ``py.test``
  2278. still works and is not scheduled for removal. Closes proposal
  2279. `#1629`_. Thanks `@obestwalter`_ and `@davehunt`_ for the complete PR
  2280. (`#1633`_).
  2281. * New cli flags:
  2282. + ``--setup-plan``: performs normal collection and reports
  2283. the potential setup and teardown and does not execute any fixtures and tests;
  2284. + ``--setup-only``: performs normal collection, executes setup and teardown of
  2285. fixtures and reports them;
  2286. + ``--setup-show``: performs normal test execution and additionally shows
  2287. setup and teardown of fixtures;
  2288. + ``--keep-duplicates``: py.test now ignores duplicated paths given in the command
  2289. line. To retain the previous behavior where the same test could be run multiple
  2290. times by specifying it in the command-line multiple times, pass the ``--keep-duplicates``
  2291. argument (`#1609`_);
  2292. Thanks `@d6e`_, `@kvas-it`_, `@sallner`_, `@ioggstream`_ and `@omarkohl`_ for the PRs.
  2293. * New CLI flag ``--override-ini``/``-o``: overrides values from the ini file.
  2294. For example: ``"-o xfail_strict=True"``'.
  2295. Thanks `@blueyed`_ and `@fengxx`_ for the PR.
  2296. * New hooks:
  2297. + ``pytest_fixture_setup(fixturedef, request)``: executes fixture setup;
  2298. + ``pytest_fixture_post_finalizer(fixturedef)``: called after the fixture's
  2299. finalizer and has access to the fixture's result cache.
  2300. Thanks `@d6e`_, `@sallner`_.
  2301. * Issue warnings for asserts whose test is a tuple literal. Such asserts will
  2302. never fail because tuples are always truthy and are usually a mistake
  2303. (see `#1562`_). Thanks `@kvas-it`_, for the PR.
  2304. * Allow passing a custom debugger class (e.g. ``--pdbcls=IPython.core.debugger:Pdb``).
  2305. Thanks to `@anntzer`_ for the PR.
  2306. **Changes**
  2307. * Plugins now benefit from assertion rewriting. Thanks
  2308. `@sober7`_, `@nicoddemus`_ and `@flub`_ for the PR.
  2309. * Change ``report.outcome`` for ``xpassed`` tests to ``"passed"`` in non-strict
  2310. mode and ``"failed"`` in strict mode. Thanks to `@hackebrot`_ for the PR
  2311. (`#1795`_) and `@gprasad84`_ for report (`#1546`_).
  2312. * Tests marked with ``xfail(strict=False)`` (the default) now appear in
  2313. JUnitXML reports as passing tests instead of skipped.
  2314. Thanks to `@hackebrot`_ for the PR (`#1795`_).
  2315. * Highlight path of the file location in the error report to make it easier to copy/paste.
  2316. Thanks `@suzaku`_ for the PR (`#1778`_).
  2317. * Fixtures marked with ``@pytest.fixture`` can now use ``yield`` statements exactly like
  2318. those marked with the ``@pytest.yield_fixture`` decorator. This change renders
  2319. ``@pytest.yield_fixture`` deprecated and makes ``@pytest.fixture`` with ``yield`` statements
  2320. the preferred way to write teardown code (`#1461`_).
  2321. Thanks `@csaftoiu`_ for bringing this to attention and `@nicoddemus`_ for the PR.
  2322. * Explicitly passed parametrize ids do not get escaped to ascii (`#1351`_).
  2323. Thanks `@ceridwen`_ for the PR.
  2324. * Fixtures are now sorted in the error message displayed when an unknown
  2325. fixture is declared in a test function.
  2326. Thanks `@nicoddemus`_ for the PR.
  2327. * ``pytest_terminal_summary`` hook now receives the ``exitstatus``
  2328. of the test session as argument. Thanks `@blueyed`_ for the PR (`#1809`_).
  2329. * Parametrize ids can accept ``None`` as specific test id, in which case the
  2330. automatically generated id for that argument will be used.
  2331. Thanks `@palaviv`_ for the complete PR (`#1468`_).
  2332. * The parameter to xunit-style setup/teardown methods (``setup_method``,
  2333. ``setup_module``, etc.) is now optional and may be omitted.
  2334. Thanks `@okken`_ for bringing this to attention and `@nicoddemus`_ for the PR.
  2335. * Improved automatic id generation selection in case of duplicate ids in
  2336. parametrize.
  2337. Thanks `@palaviv`_ for the complete PR (`#1474`_).
  2338. * Now pytest warnings summary is shown up by default. Added a new flag
  2339. ``--disable-pytest-warnings`` to explicitly disable the warnings summary (`#1668`_).
  2340. * Make ImportError during collection more explicit by reminding
  2341. the user to check the name of the test module/package(s) (`#1426`_).
  2342. Thanks `@omarkohl`_ for the complete PR (`#1520`_).
  2343. * Add ``build/`` and ``dist/`` to the default ``--norecursedirs`` list. Thanks
  2344. `@mikofski`_ for the report and `@tomviner`_ for the PR (`#1544`_).
  2345. * ``pytest.raises`` in the context manager form accepts a custom
  2346. ``message`` to raise when no exception occurred.
  2347. Thanks `@palaviv`_ for the complete PR (`#1616`_).
  2348. * ``conftest.py`` files now benefit from assertion rewriting; previously it
  2349. was only available for test modules. Thanks `@flub`_, `@sober7`_ and
  2350. `@nicoddemus`_ for the PR (`#1619`_).
  2351. * Text documents without any doctests no longer appear as "skipped".
  2352. Thanks `@graingert`_ for reporting and providing a full PR (`#1580`_).
  2353. * Ensure that a module within a namespace package can be found when it
  2354. is specified on the command line together with the ``--pyargs``
  2355. option. Thanks to `@taschini`_ for the PR (`#1597`_).
  2356. * Always include full assertion explanation during assertion rewriting. The previous behaviour was hiding
  2357. sub-expressions that happened to be ``False``, assuming this was redundant information.
  2358. Thanks `@bagerard`_ for reporting (`#1503`_). Thanks to `@davehunt`_ and
  2359. `@tomviner`_ for the PR.
  2360. * ``OptionGroup.addoption()`` now checks if option names were already
  2361. added before, to make it easier to track down issues like `#1618`_.
  2362. Before, you only got exceptions later from ``argparse`` library,
  2363. giving no clue about the actual reason for double-added options.
  2364. * ``yield``-based tests are considered deprecated and will be removed in pytest-4.0.
  2365. Thanks `@nicoddemus`_ for the PR.
  2366. * ``[pytest]`` sections in ``setup.cfg`` files should now be named ``[tool:pytest]``
  2367. to avoid conflicts with other distutils commands (see `#567`_). ``[pytest]`` sections in
  2368. ``pytest.ini`` or ``tox.ini`` files are supported and unchanged.
  2369. Thanks `@nicoddemus`_ for the PR.
  2370. * Using ``pytest_funcarg__`` prefix to declare fixtures is considered deprecated and will be
  2371. removed in pytest-4.0 (`#1684`_).
  2372. Thanks `@nicoddemus`_ for the PR.
  2373. * Passing a command-line string to ``pytest.main()`` is considered deprecated and scheduled
  2374. for removal in pytest-4.0. It is recommended to pass a list of arguments instead (`#1723`_).
  2375. * Rename ``getfuncargvalue`` to ``getfixturevalue``. ``getfuncargvalue`` is
  2376. still present but is now considered deprecated. Thanks to `@RedBeardCode`_ and `@tomviner`_
  2377. for the PR (`#1626`_).
  2378. * ``optparse`` type usage now triggers DeprecationWarnings (`#1740`_).
  2379. * ``optparse`` backward compatibility supports float/complex types (`#457`_).
  2380. * Refined logic for determining the ``rootdir``, considering only valid
  2381. paths which fixes a number of issues: `#1594`_, `#1435`_ and `#1471`_.
  2382. Updated the documentation according to current behavior. Thanks to
  2383. `@blueyed`_, `@davehunt`_ and `@matthiasha`_ for the PR.
  2384. * Always include full assertion explanation. The previous behaviour was hiding
  2385. sub-expressions that happened to be False, assuming this was redundant information.
  2386. Thanks `@bagerard`_ for reporting (`#1503`_). Thanks to `@davehunt`_ and
  2387. `@tomviner`_ for PR.
  2388. * Better message in case of not using parametrized variable (see `#1539`_).
  2389. Thanks to `@tramwaj29`_ for the PR.
  2390. * Updated docstrings with a more uniform style.
  2391. * Add stderr write for ``pytest.exit(msg)`` during startup. Previously the message was never shown.
  2392. Thanks `@BeyondEvil`_ for reporting `#1210`_. Thanks to `@JonathonSonesen`_ and
  2393. `@tomviner`_ for the PR.
  2394. * No longer display the incorrect test deselection reason (`#1372`_).
  2395. Thanks `@ronnypfannschmidt`_ for the PR.
  2396. * The ``--resultlog`` command line option has been deprecated: it is little used
  2397. and there are more modern and better alternatives (see `#830`_).
  2398. Thanks `@nicoddemus`_ for the PR.
  2399. * Improve error message with fixture lookup errors: add an 'E' to the first
  2400. line and '>' to the rest. Fixes `#717`_. Thanks `@blueyed`_ for reporting and
  2401. a PR, `@eolo999`_ for the initial PR and `@tomviner`_ for his guidance during
  2402. EuroPython2016 sprint.
  2403. **Bug Fixes**
  2404. * Parametrize now correctly handles duplicated test ids.
  2405. * Fix internal error issue when the ``method`` argument is missing for
  2406. ``teardown_method()`` (`#1605`_).
  2407. * Fix exception visualization in case the current working directory (CWD) gets
  2408. deleted during testing (`#1235`_). Thanks `@bukzor`_ for reporting. PR by
  2409. `@marscher`_.
  2410. * Improve test output for logical expression with brackets (`#925`_).
  2411. Thanks `@DRMacIver`_ for reporting and `@RedBeardCode`_ for the PR.
  2412. * Create correct diff for strings ending with newlines (`#1553`_).
  2413. Thanks `@Vogtinator`_ for reporting and `@RedBeardCode`_ and
  2414. `@tomviner`_ for the PR.
  2415. * ``ConftestImportFailure`` now shows the traceback making it easier to
  2416. identify bugs in ``conftest.py`` files (`#1516`_). Thanks `@txomon`_ for
  2417. the PR.
  2418. * Text documents without any doctests no longer appear as "skipped".
  2419. Thanks `@graingert`_ for reporting and providing a full PR (`#1580`_).
  2420. * Fixed collection of classes with custom ``__new__`` method.
  2421. Fixes `#1579`_. Thanks to `@Stranger6667`_ for the PR.
  2422. * Fixed scope overriding inside metafunc.parametrize (`#634`_).
  2423. Thanks to `@Stranger6667`_ for the PR.
  2424. * Fixed the total tests tally in junit xml output (`#1798`_).
  2425. Thanks to `@cryporchild`_ for the PR.
  2426. * Fixed off-by-one error with lines from ``request.node.warn``.
  2427. Thanks to `@blueyed`_ for the PR.
  2428. .. _#1210: https://github.com/pytest-dev/pytest/issues/1210
  2429. .. _#1235: https://github.com/pytest-dev/pytest/issues/1235
  2430. .. _#1351: https://github.com/pytest-dev/pytest/issues/1351
  2431. .. _#1372: https://github.com/pytest-dev/pytest/issues/1372
  2432. .. _#1421: https://github.com/pytest-dev/pytest/issues/1421
  2433. .. _#1426: https://github.com/pytest-dev/pytest/issues/1426
  2434. .. _#1428: https://github.com/pytest-dev/pytest/pull/1428
  2435. .. _#1435: https://github.com/pytest-dev/pytest/issues/1435
  2436. .. _#1441: https://github.com/pytest-dev/pytest/pull/1441
  2437. .. _#1444: https://github.com/pytest-dev/pytest/pull/1444
  2438. .. _#1454: https://github.com/pytest-dev/pytest/pull/1454
  2439. .. _#1461: https://github.com/pytest-dev/pytest/pull/1461
  2440. .. _#1468: https://github.com/pytest-dev/pytest/pull/1468
  2441. .. _#1471: https://github.com/pytest-dev/pytest/issues/1471
  2442. .. _#1474: https://github.com/pytest-dev/pytest/pull/1474
  2443. .. _#1479: https://github.com/pytest-dev/pytest/issues/1479
  2444. .. _#1502: https://github.com/pytest-dev/pytest/pull/1502
  2445. .. _#1503: https://github.com/pytest-dev/pytest/issues/1503
  2446. .. _#1516: https://github.com/pytest-dev/pytest/pull/1516
  2447. .. _#1519: https://github.com/pytest-dev/pytest/pull/1519
  2448. .. _#1520: https://github.com/pytest-dev/pytest/pull/1520
  2449. .. _#1526: https://github.com/pytest-dev/pytest/pull/1526
  2450. .. _#1539: https://github.com/pytest-dev/pytest/issues/1539
  2451. .. _#1544: https://github.com/pytest-dev/pytest/issues/1544
  2452. .. _#1546: https://github.com/pytest-dev/pytest/issues/1546
  2453. .. _#1553: https://github.com/pytest-dev/pytest/issues/1553
  2454. .. _#1562: https://github.com/pytest-dev/pytest/issues/1562
  2455. .. _#1579: https://github.com/pytest-dev/pytest/issues/1579
  2456. .. _#1580: https://github.com/pytest-dev/pytest/pull/1580
  2457. .. _#1594: https://github.com/pytest-dev/pytest/issues/1594
  2458. .. _#1597: https://github.com/pytest-dev/pytest/pull/1597
  2459. .. _#1605: https://github.com/pytest-dev/pytest/issues/1605
  2460. .. _#1616: https://github.com/pytest-dev/pytest/pull/1616
  2461. .. _#1618: https://github.com/pytest-dev/pytest/issues/1618
  2462. .. _#1619: https://github.com/pytest-dev/pytest/issues/1619
  2463. .. _#1626: https://github.com/pytest-dev/pytest/pull/1626
  2464. .. _#1627: https://github.com/pytest-dev/pytest/pull/1627
  2465. .. _#1628: https://github.com/pytest-dev/pytest/pull/1628
  2466. .. _#1629: https://github.com/pytest-dev/pytest/issues/1629
  2467. .. _#1632: https://github.com/pytest-dev/pytest/issues/1632
  2468. .. _#1633: https://github.com/pytest-dev/pytest/pull/1633
  2469. .. _#1664: https://github.com/pytest-dev/pytest/pull/1664
  2470. .. _#1668: https://github.com/pytest-dev/pytest/issues/1668
  2471. .. _#1684: https://github.com/pytest-dev/pytest/pull/1684
  2472. .. _#1723: https://github.com/pytest-dev/pytest/pull/1723
  2473. .. _#1740: https://github.com/pytest-dev/pytest/issues/1740
  2474. .. _#1749: https://github.com/pytest-dev/pytest/issues/1749
  2475. .. _#1778: https://github.com/pytest-dev/pytest/pull/1778
  2476. .. _#1795: https://github.com/pytest-dev/pytest/pull/1795
  2477. .. _#1798: https://github.com/pytest-dev/pytest/pull/1798
  2478. .. _#1809: https://github.com/pytest-dev/pytest/pull/1809
  2479. .. _#372: https://github.com/pytest-dev/pytest/issues/372
  2480. .. _#457: https://github.com/pytest-dev/pytest/issues/457
  2481. .. _#460: https://github.com/pytest-dev/pytest/pull/460
  2482. .. _#567: https://github.com/pytest-dev/pytest/pull/567
  2483. .. _#607: https://github.com/pytest-dev/pytest/issues/607
  2484. .. _#634: https://github.com/pytest-dev/pytest/issues/634
  2485. .. _#717: https://github.com/pytest-dev/pytest/issues/717
  2486. .. _#830: https://github.com/pytest-dev/pytest/issues/830
  2487. .. _#925: https://github.com/pytest-dev/pytest/issues/925
  2488. .. _@anntzer: https://github.com/anntzer
  2489. .. _@bagerard: https://github.com/bagerard
  2490. .. _@BeyondEvil: https://github.com/BeyondEvil
  2491. .. _@blueyed: https://github.com/blueyed
  2492. .. _@ceridwen: https://github.com/ceridwen
  2493. .. _@cryporchild: https://github.com/cryporchild
  2494. .. _@csaftoiu: https://github.com/csaftoiu
  2495. .. _@d6e: https://github.com/d6e
  2496. .. _@davehunt: https://github.com/davehunt
  2497. .. _@DRMacIver: https://github.com/DRMacIver
  2498. .. _@eolo999: https://github.com/eolo999
  2499. .. _@fengxx: https://github.com/fengxx
  2500. .. _@flub: https://github.com/flub
  2501. .. _@gprasad84: https://github.com/gprasad84
  2502. .. _@graingert: https://github.com/graingert
  2503. .. _@hartym: https://github.com/hartym
  2504. .. _@JonathonSonesen: https://github.com/JonathonSonesen
  2505. .. _@kalekundert: https://github.com/kalekundert
  2506. .. _@kvas-it: https://github.com/kvas-it
  2507. .. _@marscher: https://github.com/marscher
  2508. .. _@mikofski: https://github.com/mikofski
  2509. .. _@milliams: https://github.com/milliams
  2510. .. _@nikratio: https://github.com/nikratio
  2511. .. _@novas0x2a: https://github.com/novas0x2a
  2512. .. _@obestwalter: https://github.com/obestwalter
  2513. .. _@okken: https://github.com/okken
  2514. .. _@olegpidsadnyi: https://github.com/olegpidsadnyi
  2515. .. _@omarkohl: https://github.com/omarkohl
  2516. .. _@palaviv: https://github.com/palaviv
  2517. .. _@RedBeardCode: https://github.com/RedBeardCode
  2518. .. _@sallner: https://github.com/sallner
  2519. .. _@sober7: https://github.com/sober7
  2520. .. _@Stranger6667: https://github.com/Stranger6667
  2521. .. _@suzaku: https://github.com/suzaku
  2522. .. _@tareqalayan: https://github.com/tareqalayan
  2523. .. _@taschini: https://github.com/taschini
  2524. .. _@tramwaj29: https://github.com/tramwaj29
  2525. .. _@txomon: https://github.com/txomon
  2526. .. _@Vogtinator: https://github.com/Vogtinator
  2527. .. _@matthiasha: https://github.com/matthiasha
  2528. 2.9.2 (2016-05-31)
  2529. ==================
  2530. **Bug Fixes**
  2531. * fix `#510`_: skip tests where one parameterize dimension was empty
  2532. thanks Alex Stapleton for the Report and `@RonnyPfannschmidt`_ for the PR
  2533. * Fix Xfail does not work with condition keyword argument.
  2534. Thanks `@astraw38`_ for reporting the issue (`#1496`_) and `@tomviner`_
  2535. for PR the (`#1524`_).
  2536. * Fix win32 path issue when putting custom config file with absolute path
  2537. in ``pytest.main("-c your_absolute_path")``.
  2538. * Fix maximum recursion depth detection when raised error class is not aware
  2539. of unicode/encoded bytes.
  2540. Thanks `@prusse-martin`_ for the PR (`#1506`_).
  2541. * Fix ``pytest.mark.skip`` mark when used in strict mode.
  2542. Thanks `@pquentin`_ for the PR and `@RonnyPfannschmidt`_ for
  2543. showing how to fix the bug.
  2544. * Minor improvements and fixes to the documentation.
  2545. Thanks `@omarkohl`_ for the PR.
  2546. * Fix ``--fixtures`` to show all fixture definitions as opposed to just
  2547. one per fixture name.
  2548. Thanks to `@hackebrot`_ for the PR.
  2549. .. _#510: https://github.com/pytest-dev/pytest/issues/510
  2550. .. _#1506: https://github.com/pytest-dev/pytest/pull/1506
  2551. .. _#1496: https://github.com/pytest-dev/pytest/issues/1496
  2552. .. _#1524: https://github.com/pytest-dev/pytest/pull/1524
  2553. .. _@prusse-martin: https://github.com/prusse-martin
  2554. .. _@astraw38: https://github.com/astraw38
  2555. 2.9.1 (2016-03-17)
  2556. ==================
  2557. **Bug Fixes**
  2558. * Improve error message when a plugin fails to load.
  2559. Thanks `@nicoddemus`_ for the PR.
  2560. * Fix (`#1178 <https://github.com/pytest-dev/pytest/issues/1178>`_):
  2561. ``pytest.fail`` with non-ascii characters raises an internal pytest error.
  2562. Thanks `@nicoddemus`_ for the PR.
  2563. * Fix (`#469`_): junit parses report.nodeid incorrectly, when params IDs
  2564. contain ``::``. Thanks `@tomviner`_ for the PR (`#1431`_).
  2565. * Fix (`#578 <https://github.com/pytest-dev/pytest/issues/578>`_): SyntaxErrors
  2566. containing non-ascii lines at the point of failure generated an internal
  2567. py.test error.
  2568. Thanks `@asottile`_ for the report and `@nicoddemus`_ for the PR.
  2569. * Fix (`#1437`_): When passing in a bytestring regex pattern to parameterize
  2570. attempt to decode it as utf-8 ignoring errors.
  2571. * Fix (`#649`_): parametrized test nodes cannot be specified to run on the command line.
  2572. * Fix (`#138`_): better reporting for python 3.3+ chained exceptions
  2573. .. _#1437: https://github.com/pytest-dev/pytest/issues/1437
  2574. .. _#469: https://github.com/pytest-dev/pytest/issues/469
  2575. .. _#1431: https://github.com/pytest-dev/pytest/pull/1431
  2576. .. _#649: https://github.com/pytest-dev/pytest/issues/649
  2577. .. _#138: https://github.com/pytest-dev/pytest/issues/138
  2578. .. _@asottile: https://github.com/asottile
  2579. 2.9.0 (2016-02-29)
  2580. ==================
  2581. **New Features**
  2582. * New ``pytest.mark.skip`` mark, which unconditionally skips marked tests.
  2583. Thanks `@MichaelAquilina`_ for the complete PR (`#1040`_).
  2584. * ``--doctest-glob`` may now be passed multiple times in the command-line.
  2585. Thanks `@jab`_ and `@nicoddemus`_ for the PR.
  2586. * New ``-rp`` and ``-rP`` reporting options give the summary and full output
  2587. of passing tests, respectively. Thanks to `@codewarrior0`_ for the PR.
  2588. * ``pytest.mark.xfail`` now has a ``strict`` option, which makes ``XPASS``
  2589. tests to fail the test suite (defaulting to ``False``). There's also a
  2590. ``xfail_strict`` ini option that can be used to configure it project-wise.
  2591. Thanks `@rabbbit`_ for the request and `@nicoddemus`_ for the PR (`#1355`_).
  2592. * ``Parser.addini`` now supports options of type ``bool``.
  2593. Thanks `@nicoddemus`_ for the PR.
  2594. * New ``ALLOW_BYTES`` doctest option. This strips ``b`` prefixes from byte strings
  2595. in doctest output (similar to ``ALLOW_UNICODE``).
  2596. Thanks `@jaraco`_ for the request and `@nicoddemus`_ for the PR (`#1287`_).
  2597. * Give a hint on ``KeyboardInterrupt`` to use the ``--fulltrace`` option to show the errors.
  2598. Fixes `#1366`_.
  2599. Thanks to `@hpk42`_ for the report and `@RonnyPfannschmidt`_ for the PR.
  2600. * Catch ``IndexError`` exceptions when getting exception source location.
  2601. Fixes a pytest internal error for dynamically generated code (fixtures and tests)
  2602. where source lines are fake by intention.
  2603. **Changes**
  2604. * **Important**: `py.code <https://pylib.readthedocs.io/en/latest/code.html>`_ has been
  2605. merged into the ``pytest`` repository as ``pytest._code``. This decision
  2606. was made because ``py.code`` had very few uses outside ``pytest`` and the
  2607. fact that it was in a different repository made it difficult to fix bugs on
  2608. its code in a timely manner. The team hopes with this to be able to better
  2609. refactor out and improve that code.
  2610. This change shouldn't affect users, but it is useful to let users aware
  2611. if they encounter any strange behavior.
  2612. Keep in mind that the code for ``pytest._code`` is **private** and
  2613. **experimental**, so you definitely should not import it explicitly!
  2614. Please note that the original ``py.code`` is still available in
  2615. `pylib <https://pylib.readthedocs.io>`_.
  2616. * ``pytest_enter_pdb`` now optionally receives the pytest config object.
  2617. Thanks `@nicoddemus`_ for the PR.
  2618. * Removed code and documentation for Python 2.5 or lower versions,
  2619. including removal of the obsolete ``_pytest.assertion.oldinterpret`` module.
  2620. Thanks `@nicoddemus`_ for the PR (`#1226`_).
  2621. * Comparisons now always show up in full when ``CI`` or ``BUILD_NUMBER`` is
  2622. found in the environment, even when ``-vv`` isn't used.
  2623. Thanks `@The-Compiler`_ for the PR.
  2624. * ``--lf`` and ``--ff`` now support long names: ``--last-failed`` and
  2625. ``--failed-first`` respectively.
  2626. Thanks `@MichaelAquilina`_ for the PR.
  2627. * Added expected exceptions to ``pytest.raises`` fail message.
  2628. * Collection only displays progress ("collecting X items") when in a terminal.
  2629. This avoids cluttering the output when using ``--color=yes`` to obtain
  2630. colors in CI integrations systems (`#1397`_).
  2631. **Bug Fixes**
  2632. * The ``-s`` and ``-c`` options should now work under ``xdist``;
  2633. ``Config.fromdictargs`` now represents its input much more faithfully.
  2634. Thanks to `@bukzor`_ for the complete PR (`#680`_).
  2635. * Fix (`#1290`_): support Python 3.5's ``@`` operator in assertion rewriting.
  2636. Thanks `@Shinkenjoe`_ for report with test case and `@tomviner`_ for the PR.
  2637. * Fix formatting utf-8 explanation messages (`#1379`_).
  2638. Thanks `@biern`_ for the PR.
  2639. * Fix `traceback style docs`_ to describe all of the available options
  2640. (auto/long/short/line/native/no), with ``auto`` being the default since v2.6.
  2641. Thanks `@hackebrot`_ for the PR.
  2642. * Fix (`#1422`_): junit record_xml_property doesn't allow multiple records
  2643. with same name.
  2644. .. _`traceback style docs`: https://pytest.org/latest/usage.html#modifying-python-traceback-printing
  2645. .. _#1609: https://github.com/pytest-dev/pytest/issues/1609
  2646. .. _#1422: https://github.com/pytest-dev/pytest/issues/1422
  2647. .. _#1379: https://github.com/pytest-dev/pytest/issues/1379
  2648. .. _#1366: https://github.com/pytest-dev/pytest/issues/1366
  2649. .. _#1040: https://github.com/pytest-dev/pytest/pull/1040
  2650. .. _#680: https://github.com/pytest-dev/pytest/issues/680
  2651. .. _#1287: https://github.com/pytest-dev/pytest/pull/1287
  2652. .. _#1226: https://github.com/pytest-dev/pytest/pull/1226
  2653. .. _#1290: https://github.com/pytest-dev/pytest/pull/1290
  2654. .. _#1355: https://github.com/pytest-dev/pytest/pull/1355
  2655. .. _#1397: https://github.com/pytest-dev/pytest/issues/1397
  2656. .. _@biern: https://github.com/biern
  2657. .. _@MichaelAquilina: https://github.com/MichaelAquilina
  2658. .. _@bukzor: https://github.com/bukzor
  2659. .. _@hpk42: https://github.com/hpk42
  2660. .. _@nicoddemus: https://github.com/nicoddemus
  2661. .. _@jab: https://github.com/jab
  2662. .. _@codewarrior0: https://github.com/codewarrior0
  2663. .. _@jaraco: https://github.com/jaraco
  2664. .. _@The-Compiler: https://github.com/The-Compiler
  2665. .. _@Shinkenjoe: https://github.com/Shinkenjoe
  2666. .. _@tomviner: https://github.com/tomviner
  2667. .. _@RonnyPfannschmidt: https://github.com/RonnyPfannschmidt
  2668. .. _@rabbbit: https://github.com/rabbbit
  2669. .. _@hackebrot: https://github.com/hackebrot
  2670. .. _@pquentin: https://github.com/pquentin
  2671. .. _@ioggstream: https://github.com/ioggstream
  2672. 2.8.7 (2016-01-24)
  2673. ==================
  2674. - fix #1338: use predictable object resolution for monkeypatch
  2675. 2.8.6 (2016-01-21)
  2676. ==================
  2677. - fix #1259: allow for double nodeids in junitxml,
  2678. this was a regression failing plugins combinations
  2679. like pytest-pep8 + pytest-flakes
  2680. - Workaround for exception that occurs in pyreadline when using
  2681. ``--pdb`` with standard I/O capture enabled.
  2682. Thanks Erik M. Bray for the PR.
  2683. - fix #900: Better error message in case the target of a ``monkeypatch`` call
  2684. raises an ``ImportError``.
  2685. - fix #1292: monkeypatch calls (setattr, setenv, etc.) are now O(1).
  2686. Thanks David R. MacIver for the report and Bruno Oliveira for the PR.
  2687. - fix #1223: captured stdout and stderr are now properly displayed before
  2688. entering pdb when ``--pdb`` is used instead of being thrown away.
  2689. Thanks Cal Leeming for the PR.
  2690. - fix #1305: pytest warnings emitted during ``pytest_terminal_summary`` are now
  2691. properly displayed.
  2692. Thanks Ionel Maries Cristian for the report and Bruno Oliveira for the PR.
  2693. - fix #628: fixed internal UnicodeDecodeError when doctests contain unicode.
  2694. Thanks Jason R. Coombs for the report and Bruno Oliveira for the PR.
  2695. - fix #1334: Add captured stdout to jUnit XML report on setup error.
  2696. Thanks Georgy Dyuldin for the PR.
  2697. 2.8.5 (2015-12-11)
  2698. ==================
  2699. - fix #1243: fixed issue where class attributes injected during collection could break pytest.
  2700. PR by Alexei Kozlenok, thanks Ronny Pfannschmidt and Bruno Oliveira for the review and help.
  2701. - fix #1074: precompute junitxml chunks instead of storing the whole tree in objects
  2702. Thanks Bruno Oliveira for the report and Ronny Pfannschmidt for the PR
  2703. - fix #1238: fix ``pytest.deprecated_call()`` receiving multiple arguments
  2704. (Regression introduced in 2.8.4). Thanks Alex Gaynor for the report and
  2705. Bruno Oliveira for the PR.
  2706. 2.8.4 (2015-12-06)
  2707. ==================
  2708. - fix #1190: ``deprecated_call()`` now works when the deprecated
  2709. function has been already called by another test in the same
  2710. module. Thanks Mikhail Chernykh for the report and Bruno Oliveira for the
  2711. PR.
  2712. - fix #1198: ``--pastebin`` option now works on Python 3. Thanks
  2713. Mehdy Khoshnoody for the PR.
  2714. - fix #1219: ``--pastebin`` now works correctly when captured output contains
  2715. non-ascii characters. Thanks Bruno Oliveira for the PR.
  2716. - fix #1204: another error when collecting with a nasty __getattr__().
  2717. Thanks Florian Bruhin for the PR.
  2718. - fix the summary printed when no tests did run.
  2719. Thanks Florian Bruhin for the PR.
  2720. - fix #1185 - ensure MANIFEST.in exactly matches what should go to a sdist
  2721. - a number of documentation modernizations wrt good practices.
  2722. Thanks Bruno Oliveira for the PR.
  2723. 2.8.3 (2015-11-18)
  2724. ==================
  2725. - fix #1169: add __name__ attribute to testcases in TestCaseFunction to
  2726. support the @unittest.skip decorator on functions and methods.
  2727. Thanks Lee Kamentsky for the PR.
  2728. - fix #1035: collecting tests if test module level obj has __getattr__().
  2729. Thanks Suor for the report and Bruno Oliveira / Tom Viner for the PR.
  2730. - fix #331: don't collect tests if their failure cannot be reported correctly
  2731. e.g. they are a callable instance of a class.
  2732. - fix #1133: fixed internal error when filtering tracebacks where one entry
  2733. belongs to a file which is no longer available.
  2734. Thanks Bruno Oliveira for the PR.
  2735. - enhancement made to highlight in red the name of the failing tests so
  2736. they stand out in the output.
  2737. Thanks Gabriel Reis for the PR.
  2738. - add more talks to the documentation
  2739. - extend documentation on the --ignore cli option
  2740. - use pytest-runner for setuptools integration
  2741. - minor fixes for interaction with OS X El Capitan
  2742. system integrity protection (thanks Florian)
  2743. 2.8.2 (2015-10-07)
  2744. ==================
  2745. - fix #1085: proper handling of encoding errors when passing encoded byte
  2746. strings to pytest.parametrize in Python 2.
  2747. Thanks Themanwithoutaplan for the report and Bruno Oliveira for the PR.
  2748. - fix #1087: handling SystemError when passing empty byte strings to
  2749. pytest.parametrize in Python 3.
  2750. Thanks Paul Kehrer for the report and Bruno Oliveira for the PR.
  2751. - fix #995: fixed internal error when filtering tracebacks where one entry
  2752. was generated by an exec() statement.
  2753. Thanks Daniel Hahler, Ashley C Straw, Philippe Gauthier and Pavel Savchenko
  2754. for contributing and Bruno Oliveira for the PR.
  2755. - fix #1100 and #1057: errors when using autouse fixtures and doctest modules.
  2756. Thanks Sergey B Kirpichev and Vital Kudzelka for contributing and Bruno
  2757. Oliveira for the PR.
  2758. 2.8.1 (2015-09-29)
  2759. ==================
  2760. - fix #1034: Add missing nodeid on pytest_logwarning call in
  2761. addhook. Thanks Simon Gomizelj for the PR.
  2762. - 'deprecated_call' is now only satisfied with a DeprecationWarning or
  2763. PendingDeprecationWarning. Before 2.8.0, it accepted any warning, and 2.8.0
  2764. made it accept only DeprecationWarning (but not PendingDeprecationWarning).
  2765. Thanks Alex Gaynor for the issue and Eric Hunsberger for the PR.
  2766. - fix issue #1073: avoid calling __getattr__ on potential plugin objects.
  2767. This fixes an incompatibility with pytest-django. Thanks Andreas Pelme,
  2768. Bruno Oliveira and Ronny Pfannschmidt for contributing and Holger Krekel
  2769. for the fix.
  2770. - Fix issue #704: handle versionconflict during plugin loading more
  2771. gracefully. Thanks Bruno Oliveira for the PR.
  2772. - Fix issue #1064: ""--junitxml" regression when used with the
  2773. "pytest-xdist" plugin, with test reports being assigned to the wrong tests.
  2774. Thanks Daniel Grunwald for the report and Bruno Oliveira for the PR.
  2775. - (experimental) adapt more SEMVER style versioning and change meaning of
  2776. master branch in git repo: "master" branch now keeps the bugfixes, changes
  2777. aimed for micro releases. "features" branch will only be released
  2778. with minor or major pytest releases.
  2779. - Fix issue #766 by removing documentation references to distutils.
  2780. Thanks Russel Winder.
  2781. - Fix issue #1030: now byte-strings are escaped to produce item node ids
  2782. to make them always serializable.
  2783. Thanks Andy Freeland for the report and Bruno Oliveira for the PR.
  2784. - Python 2: if unicode parametrized values are convertible to ascii, their
  2785. ascii representation is used for the node id.
  2786. - Fix issue #411: Add __eq__ method to assertion comparison example.
  2787. Thanks Ben Webb.
  2788. - Fix issue #653: deprecated_call can be used as context manager.
  2789. - fix issue 877: properly handle assertion explanations with non-ascii repr
  2790. Thanks Mathieu Agopian for the report and Ronny Pfannschmidt for the PR.
  2791. - fix issue 1029: transform errors when writing cache values into pytest-warnings
  2792. 2.8.0 (2015-09-18)
  2793. ==================
  2794. - new ``--lf`` and ``-ff`` options to run only the last failing tests or
  2795. "failing tests first" from the last run. This functionality is provided
  2796. through porting the formerly external pytest-cache plugin into pytest core.
  2797. BACKWARD INCOMPAT: if you used pytest-cache's functionality to persist
  2798. data between test runs be aware that we don't serialize sets anymore.
  2799. Thanks Ronny Pfannschmidt for most of the merging work.
  2800. - "-r" option now accepts "a" to include all possible reports, similar
  2801. to passing "fEsxXw" explicitly (isse960).
  2802. Thanks Abhijeet Kasurde for the PR.
  2803. - avoid python3.5 deprecation warnings by introducing version
  2804. specific inspection helpers, thanks Michael Droettboom.
  2805. - fix issue562: @nose.tools.istest now fully respected.
  2806. - fix issue934: when string comparison fails and a diff is too large to display
  2807. without passing -vv, still show a few lines of the diff.
  2808. Thanks Florian Bruhin for the report and Bruno Oliveira for the PR.
  2809. - fix issue736: Fix a bug where fixture params would be discarded when combined
  2810. with parametrization markers.
  2811. Thanks to Markus Unterwaditzer for the PR.
  2812. - fix issue710: introduce ALLOW_UNICODE doctest option: when enabled, the
  2813. ``u`` prefix is stripped from unicode strings in expected doctest output. This
  2814. allows doctests which use unicode to run in Python 2 and 3 unchanged.
  2815. Thanks Jason R. Coombs for the report and Bruno Oliveira for the PR.
  2816. - parametrize now also generates meaningful test IDs for enum, regex and class
  2817. objects (as opposed to class instances).
  2818. Thanks to Florian Bruhin for the PR.
  2819. - Add 'warns' to assert that warnings are thrown (like 'raises').
  2820. Thanks to Eric Hunsberger for the PR.
  2821. - Fix issue683: Do not apply an already applied mark. Thanks ojake for the PR.
  2822. - Deal with capturing failures better so fewer exceptions get lost to
  2823. /dev/null. Thanks David Szotten for the PR.
  2824. - fix issue730: deprecate and warn about the --genscript option.
  2825. Thanks Ronny Pfannschmidt for the report and Christian Pommranz for the PR.
  2826. - fix issue751: multiple parametrize with ids bug if it parametrizes class with
  2827. two or more test methods. Thanks Sergey Chipiga for reporting and Jan
  2828. Bednarik for PR.
  2829. - fix issue82: avoid loading conftest files from setup.cfg/pytest.ini/tox.ini
  2830. files and upwards by default (--confcutdir can still be set to override this).
  2831. Thanks Bruno Oliveira for the PR.
  2832. - fix issue768: docstrings found in python modules were not setting up session
  2833. fixtures. Thanks Jason R. Coombs for reporting and Bruno Oliveira for the PR.
  2834. - added ``tmpdir_factory``, a session-scoped fixture that can be used to create
  2835. directories under the base temporary directory. Previously this object was
  2836. installed as a ``_tmpdirhandler`` attribute of the ``config`` object, but now it
  2837. is part of the official API and using ``config._tmpdirhandler`` is
  2838. deprecated.
  2839. Thanks Bruno Oliveira for the PR.
  2840. - fix issue808: pytest's internal assertion rewrite hook now implements the
  2841. optional PEP302 get_data API so tests can access data files next to them.
  2842. Thanks xmo-odoo for request and example and Bruno Oliveira for
  2843. the PR.
  2844. - rootdir and inifile are now displayed during usage errors to help
  2845. users diagnose problems such as unexpected ini files which add
  2846. unknown options being picked up by pytest. Thanks to Pavel Savchenko for
  2847. bringing the problem to attention in #821 and Bruno Oliveira for the PR.
  2848. - Summary bar now is colored yellow for warning
  2849. situations such as: all tests either were skipped or xpass/xfailed,
  2850. or no tests were run at all (this is a partial fix for issue500).
  2851. - fix issue812: pytest now exits with status code 5 in situations where no
  2852. tests were run at all, such as the directory given in the command line does
  2853. not contain any tests or as result of a command line option filters
  2854. all out all tests (-k for example).
  2855. Thanks Eric Siegerman (issue812) and Bruno Oliveira for the PR.
  2856. - Summary bar now is colored yellow for warning
  2857. situations such as: all tests either were skipped or xpass/xfailed,
  2858. or no tests were run at all (related to issue500).
  2859. Thanks Eric Siegerman.
  2860. - New ``testpaths`` ini option: list of directories to search for tests
  2861. when executing pytest from the root directory. This can be used
  2862. to speed up test collection when a project has well specified directories
  2863. for tests, being usually more practical than configuring norecursedirs for
  2864. all directories that do not contain tests.
  2865. Thanks to Adrian for idea (#694) and Bruno Oliveira for the PR.
  2866. - fix issue713: JUnit XML reports for doctest failures.
  2867. Thanks Punyashloka Biswal.
  2868. - fix issue970: internal pytest warnings now appear as "pytest-warnings" in
  2869. the terminal instead of "warnings", so it is clear for users that those
  2870. warnings are from pytest and not from the builtin "warnings" module.
  2871. Thanks Bruno Oliveira.
  2872. - Include setup and teardown in junitxml test durations.
  2873. Thanks Janne Vanhala.
  2874. - fix issue735: assertion failures on debug versions of Python 3.4+
  2875. - new option ``--import-mode`` to allow to change test module importing
  2876. behaviour to append to sys.path instead of prepending. This better allows
  2877. to run test modules against installed versions of a package even if the
  2878. package under test has the same import root. In this example::
  2879. testing/__init__.py
  2880. testing/test_pkg_under_test.py
  2881. pkg_under_test/
  2882. the tests will run against the installed version
  2883. of pkg_under_test when ``--import-mode=append`` is used whereas
  2884. by default they would always pick up the local version. Thanks Holger Krekel.
  2885. - pytester: add method ``TmpTestdir.delete_loaded_modules()``, and call it
  2886. from ``inline_run()`` to allow temporary modules to be reloaded.
  2887. Thanks Eduardo Schettino.
  2888. - internally refactor pluginmanager API and code so that there
  2889. is a clear distinction between a pytest-agnostic rather simple
  2890. pluginmanager and the PytestPluginManager which adds a lot of
  2891. behaviour, among it handling of the local conftest files.
  2892. In terms of documented methods this is a backward compatible
  2893. change but it might still break 3rd party plugins which relied on
  2894. details like especially the pluginmanager.add_shutdown() API.
  2895. Thanks Holger Krekel.
  2896. - pluginmanagement: introduce ``pytest.hookimpl`` and
  2897. ``pytest.hookspec`` decorators for setting impl/spec
  2898. specific parameters. This substitutes the previous
  2899. now deprecated use of ``pytest.mark`` which is meant to
  2900. contain markers for test functions only.
  2901. - write/refine docs for "writing plugins" which now have their
  2902. own page and are separate from the "using/installing plugins`` page.
  2903. - fix issue732: properly unregister plugins from any hook calling
  2904. sites allowing to have temporary plugins during test execution.
  2905. - deprecate and warn about ``__multicall__`` argument in hook
  2906. implementations. Use the ``hookwrapper`` mechanism instead already
  2907. introduced with pytest-2.7.
  2908. - speed up pytest's own test suite considerably by using inprocess
  2909. tests by default (testrun can be modified with --runpytest=subprocess
  2910. to create subprocesses in many places instead). The main
  2911. APIs to run pytest in a test is "runpytest()" or "runpytest_subprocess"
  2912. and "runpytest_inprocess" if you need a particular way of running
  2913. the test. In all cases you get back a RunResult but the inprocess
  2914. one will also have a "reprec" attribute with the recorded events/reports.
  2915. - fix monkeypatch.setattr("x.y", raising=False) to actually not raise
  2916. if "y" is not a pre-existing attribute. Thanks Florian Bruhin.
  2917. - fix issue741: make running output from testdir.run copy/pasteable
  2918. Thanks Bruno Oliveira.
  2919. - add a new ``--noconftest`` argument which ignores all ``conftest.py`` files.
  2920. - add ``file`` and ``line`` attributes to JUnit-XML output.
  2921. - fix issue890: changed extension of all documentation files from ``txt`` to
  2922. ``rst``. Thanks to Abhijeet for the PR.
  2923. - fix issue714: add ability to apply indirect=True parameter on particular argnames.
  2924. Thanks Elizaveta239.
  2925. - fix issue890: changed extension of all documentation files from ``txt`` to
  2926. ``rst``. Thanks to Abhijeet for the PR.
  2927. - fix issue957: "# doctest: SKIP" option will now register doctests as SKIPPED
  2928. rather than PASSED.
  2929. Thanks Thomas Grainger for the report and Bruno Oliveira for the PR.
  2930. - issue951: add new record_xml_property fixture, that supports logging
  2931. additional information on xml output. Thanks David Diaz for the PR.
  2932. - issue949: paths after normal options (for example ``-s``, ``-v``, etc) are now
  2933. properly used to discover ``rootdir`` and ``ini`` files.
  2934. Thanks Peter Lauri for the report and Bruno Oliveira for the PR.
  2935. 2.7.3 (2015-09-15)
  2936. ==================
  2937. - Allow 'dev', 'rc', or other non-integer version strings in ``importorskip``.
  2938. Thanks to Eric Hunsberger for the PR.
  2939. - fix issue856: consider --color parameter in all outputs (for example
  2940. --fixtures). Thanks Barney Gale for the report and Bruno Oliveira for the PR.
  2941. - fix issue855: passing str objects as ``plugins`` argument to pytest.main
  2942. is now interpreted as a module name to be imported and registered as a
  2943. plugin, instead of silently having no effect.
  2944. Thanks xmo-odoo for the report and Bruno Oliveira for the PR.
  2945. - fix issue744: fix for ast.Call changes in Python 3.5+. Thanks
  2946. Guido van Rossum, Matthias Bussonnier, Stefan Zimmermann and
  2947. Thomas Kluyver.
  2948. - fix issue842: applying markers in classes no longer propagate this markers
  2949. to superclasses which also have markers.
  2950. Thanks xmo-odoo for the report and Bruno Oliveira for the PR.
  2951. - preserve warning functions after call to pytest.deprecated_call. Thanks
  2952. Pieter Mulder for PR.
  2953. - fix issue854: autouse yield_fixtures defined as class members of
  2954. unittest.TestCase subclasses now work as expected.
  2955. Thannks xmo-odoo for the report and Bruno Oliveira for the PR.
  2956. - fix issue833: --fixtures now shows all fixtures of collected test files, instead of just the
  2957. fixtures declared on the first one.
  2958. Thanks Florian Bruhin for reporting and Bruno Oliveira for the PR.
  2959. - fix issue863: skipped tests now report the correct reason when a skip/xfail
  2960. condition is met when using multiple markers.
  2961. Thanks Raphael Pierzina for reporting and Bruno Oliveira for the PR.
  2962. - optimized tmpdir fixture initialization, which should make test sessions
  2963. faster (specially when using pytest-xdist). The only visible effect
  2964. is that now pytest uses a subdirectory in the $TEMP directory for all
  2965. directories created by this fixture (defaults to $TEMP/pytest-$USER).
  2966. Thanks Bruno Oliveira for the PR.
  2967. 2.7.2 (2015-06-23)
  2968. ==================
  2969. - fix issue767: pytest.raises value attribute does not contain the exception
  2970. instance on Python 2.6. Thanks Eric Siegerman for providing the test
  2971. case and Bruno Oliveira for PR.
  2972. - Automatically create directory for junitxml and results log.
  2973. Thanks Aron Curzon.
  2974. - fix issue713: JUnit XML reports for doctest failures.
  2975. Thanks Punyashloka Biswal.
  2976. - fix issue735: assertion failures on debug versions of Python 3.4+
  2977. Thanks Benjamin Peterson.
  2978. - fix issue114: skipif marker reports to internal skipping plugin;
  2979. Thanks Floris Bruynooghe for reporting and Bruno Oliveira for the PR.
  2980. - fix issue748: unittest.SkipTest reports to internal pytest unittest plugin.
  2981. Thanks Thomas De Schampheleire for reporting and Bruno Oliveira for the PR.
  2982. - fix issue718: failed to create representation of sets containing unsortable
  2983. elements in python 2. Thanks Edison Gustavo Muenz.
  2984. - fix issue756, fix issue752 (and similar issues): depend on py-1.4.29
  2985. which has a refined algorithm for traceback generation.
  2986. 2.7.1 (2015-05-19)
  2987. ==================
  2988. - fix issue731: do not get confused by the braces which may be present
  2989. and unbalanced in an object's repr while collapsing False
  2990. explanations. Thanks Carl Meyer for the report and test case.
  2991. - fix issue553: properly handling inspect.getsourcelines failures in
  2992. FixtureLookupError which would lead to an internal error,
  2993. obfuscating the original problem. Thanks talljosh for initial
  2994. diagnose/patch and Bruno Oliveira for final patch.
  2995. - fix issue660: properly report scope-mismatch-access errors
  2996. independently from ordering of fixture arguments. Also
  2997. avoid the pytest internal traceback which does not provide
  2998. information to the user. Thanks Holger Krekel.
  2999. - streamlined and documented release process. Also all versions
  3000. (in setup.py and documentation generation) are now read
  3001. from _pytest/__init__.py. Thanks Holger Krekel.
  3002. - fixed docs to remove the notion that yield-fixtures are experimental.
  3003. They are here to stay :) Thanks Bruno Oliveira.
  3004. - Support building wheels by using environment markers for the
  3005. requirements. Thanks Ionel Maries Cristian.
  3006. - fixed regression to 2.6.4 which surfaced e.g. in lost stdout capture printing
  3007. when tests raised SystemExit. Thanks Holger Krekel.
  3008. - reintroduced _pytest fixture of the pytester plugin which is used
  3009. at least by pytest-xdist.
  3010. 2.7.0 (2015-03-26)
  3011. ==================
  3012. - fix issue435: make reload() work when assert rewriting is active.
  3013. Thanks Daniel Hahler.
  3014. - fix issue616: conftest.py files and their contained fixutres are now
  3015. properly considered for visibility, independently from the exact
  3016. current working directory and test arguments that are used.
  3017. Many thanks to Eric Siegerman and his PR235 which contains
  3018. systematic tests for conftest visibility and now passes.
  3019. This change also introduces the concept of a ``rootdir`` which
  3020. is printed as a new pytest header and documented in the pytest
  3021. customize web page.
  3022. - change reporting of "diverted" tests, i.e. tests that are collected
  3023. in one file but actually come from another (e.g. when tests in a test class
  3024. come from a base class in a different file). We now show the nodeid
  3025. and indicate via a postfix the other file.
  3026. - add ability to set command line options by environment variable PYTEST_ADDOPTS.
  3027. - added documentation on the new pytest-dev teams on bitbucket and
  3028. github. See https://pytest.org/latest/contributing.html .
  3029. Thanks to Anatoly for pushing and initial work on this.
  3030. - fix issue650: new option ``--docttest-ignore-import-errors`` which
  3031. will turn import errors in doctests into skips. Thanks Charles Cloud
  3032. for the complete PR.
  3033. - fix issue655: work around different ways that cause python2/3
  3034. to leak sys.exc_info into fixtures/tests causing failures in 3rd party code
  3035. - fix issue615: assertion rewriting did not correctly escape % signs
  3036. when formatting boolean operations, which tripped over mixing
  3037. booleans with modulo operators. Thanks to Tom Viner for the report,
  3038. triaging and fix.
  3039. - implement issue351: add ability to specify parametrize ids as a callable
  3040. to generate custom test ids. Thanks Brianna Laugher for the idea and
  3041. implementation.
  3042. - introduce and document new hookwrapper mechanism useful for plugins
  3043. which want to wrap the execution of certain hooks for their purposes.
  3044. This supersedes the undocumented ``__multicall__`` protocol which
  3045. pytest itself and some external plugins use. Note that pytest-2.8
  3046. is scheduled to drop supporting the old ``__multicall__``
  3047. and only support the hookwrapper protocol.
  3048. - majorly speed up invocation of plugin hooks
  3049. - use hookwrapper mechanism in builtin pytest plugins.
  3050. - add a doctest ini option for doctest flags, thanks Holger Peters.
  3051. - add note to docs that if you want to mark a parameter and the
  3052. parameter is a callable, you also need to pass in a reason to disambiguate
  3053. it from the "decorator" case. Thanks Tom Viner.
  3054. - "python_classes" and "python_functions" options now support glob-patterns
  3055. for test discovery, as discussed in issue600. Thanks Ldiary Translations.
  3056. - allow to override parametrized fixtures with non-parametrized ones and vice versa (bubenkoff).
  3057. - fix issue463: raise specific error for 'parameterize' misspelling (pfctdayelise).
  3058. - On failure, the ``sys.last_value``, ``sys.last_type`` and
  3059. ``sys.last_traceback`` are set, so that a user can inspect the error
  3060. via postmortem debugging (almarklein).
  3061. 2.6.4 (2014-10-24)
  3062. ==================
  3063. - Improve assertion failure reporting on iterables, by using ndiff and
  3064. pprint.
  3065. - removed outdated japanese docs from source tree.
  3066. - docs for "pytest_addhooks" hook. Thanks Bruno Oliveira.
  3067. - updated plugin index docs. Thanks Bruno Oliveira.
  3068. - fix issue557: with "-k" we only allow the old style "-" for negation
  3069. at the beginning of strings and even that is deprecated. Use "not" instead.
  3070. This should allow to pick parametrized tests where "-" appeared in the parameter.
  3071. - fix issue604: Escape % character in the assertion message.
  3072. - fix issue620: add explanation in the --genscript target about what
  3073. the binary blob means. Thanks Dinu Gherman.
  3074. - fix issue614: fixed pastebin support.
  3075. - fix issue620: add explanation in the --genscript target about what
  3076. the binary blob means. Thanks Dinu Gherman.
  3077. - fix issue614: fixed pastebin support.
  3078. 2.6.3 (2014-09-24)
  3079. ==================
  3080. - fix issue575: xunit-xml was reporting collection errors as failures
  3081. instead of errors, thanks Oleg Sinyavskiy.
  3082. - fix issue582: fix setuptools example, thanks Laszlo Papp and Ronny
  3083. Pfannschmidt.
  3084. - Fix infinite recursion bug when pickling capture.EncodedFile, thanks
  3085. Uwe Schmitt.
  3086. - fix issue589: fix bad interaction with numpy and others when showing
  3087. exceptions. Check for precise "maximum recursion depth exceed" exception
  3088. instead of presuming any RuntimeError is that one (implemented in py
  3089. dep). Thanks Charles Cloud for analysing the issue.
  3090. - fix conftest related fixture visibility issue: when running with a
  3091. CWD outside of a test package pytest would get fixture discovery wrong.
  3092. Thanks to Wolfgang Schnerring for figuring out a reproducible example.
  3093. - Introduce pytest_enter_pdb hook (needed e.g. by pytest_timeout to cancel the
  3094. timeout when interactively entering pdb). Thanks Wolfgang Schnerring.
  3095. - check xfail/skip also with non-python function test items. Thanks
  3096. Floris Bruynooghe.
  3097. 2.6.2 (2014-09-05)
  3098. ==================
  3099. - Added function pytest.freeze_includes(), which makes it easy to embed
  3100. pytest into executables using tools like cx_freeze.
  3101. See docs for examples and rationale. Thanks Bruno Oliveira.
  3102. - Improve assertion rewriting cache invalidation precision.
  3103. - fixed issue561: adapt autouse fixture example for python3.
  3104. - fixed issue453: assertion rewriting issue with __repr__ containing
  3105. "\n{", "\n}" and "\n~".
  3106. - fix issue560: correctly display code if an "else:" or "finally:" is
  3107. followed by statements on the same line.
  3108. - Fix example in monkeypatch documentation, thanks t-8ch.
  3109. - fix issue572: correct tmpdir doc example for python3.
  3110. - Do not mark as universal wheel because Python 2.6 is different from
  3111. other builds due to the extra argparse dependency. Fixes issue566.
  3112. Thanks sontek.
  3113. - Implement issue549: user-provided assertion messages now no longer
  3114. replace the py.test introspection message but are shown in addition
  3115. to them.
  3116. 2.6.1 (2014-08-07)
  3117. ==================
  3118. - No longer show line numbers in the --verbose output, the output is now
  3119. purely the nodeid. The line number is still shown in failure reports.
  3120. Thanks Floris Bruynooghe.
  3121. - fix issue437 where assertion rewriting could cause pytest-xdist slaves
  3122. to collect different tests. Thanks Bruno Oliveira.
  3123. - fix issue555: add "errors" attribute to capture-streams to satisfy
  3124. some distutils and possibly other code accessing sys.stdout.errors.
  3125. - fix issue547 capsys/capfd also work when output capturing ("-s") is disabled.
  3126. - address issue170: allow pytest.mark.xfail(...) to specify expected exceptions via
  3127. an optional "raises=EXC" argument where EXC can be a single exception
  3128. or a tuple of exception classes. Thanks David Mohr for the complete
  3129. PR.
  3130. - fix integration of pytest with unittest.mock.patch decorator when
  3131. it uses the "new" argument. Thanks Nicolas Delaby for test and PR.
  3132. - fix issue with detecting conftest files if the arguments contain
  3133. "::" node id specifications (copy pasted from "-v" output)
  3134. - fix issue544 by only removing "@NUM" at the end of "::" separated parts
  3135. and if the part has a ".py" extension
  3136. - don't use py.std import helper, rather import things directly.
  3137. Thanks Bruno Oliveira.
  3138. 2.6
  3139. ===
  3140. - Cache exceptions from fixtures according to their scope (issue 467).
  3141. - fix issue537: Avoid importing old assertion reinterpretation code by default.
  3142. - fix issue364: shorten and enhance tracebacks representation by default.
  3143. The new "--tb=auto" option (default) will only display long tracebacks
  3144. for the first and last entry. You can get the old behaviour of printing
  3145. all entries as long entries with "--tb=long". Also short entries by
  3146. default are now printed very similarly to "--tb=native" ones.
  3147. - fix issue514: teach assertion reinterpretation about private class attributes
  3148. - change -v output to include full node IDs of tests. Users can copy
  3149. a node ID from a test run, including line number, and use it as a
  3150. positional argument in order to run only a single test.
  3151. - fix issue 475: fail early and comprehensible if calling
  3152. pytest.raises with wrong exception type.
  3153. - fix issue516: tell in getting-started about current dependencies.
  3154. - cleanup setup.py a bit and specify supported versions. Thanks Jurko
  3155. Gospodnetic for the PR.
  3156. - change XPASS colour to yellow rather then red when tests are run
  3157. with -v.
  3158. - fix issue473: work around mock putting an unbound method into a class
  3159. dict when double-patching.
  3160. - fix issue498: if a fixture finalizer fails, make sure that
  3161. the fixture is still invalidated.
  3162. - fix issue453: the result of the pytest_assertrepr_compare hook now gets
  3163. it's newlines escaped so that format_exception does not blow up.
  3164. - internal new warning system: pytest will now produce warnings when
  3165. it detects oddities in your test collection or execution.
  3166. Warnings are ultimately sent to a new pytest_logwarning hook which is
  3167. currently only implemented by the terminal plugin which displays
  3168. warnings in the summary line and shows more details when -rw (report on
  3169. warnings) is specified.
  3170. - change skips into warnings for test classes with an __init__ and
  3171. callables in test modules which look like a test but are not functions.
  3172. - fix issue436: improved finding of initial conftest files from command
  3173. line arguments by using the result of parse_known_args rather than
  3174. the previous flaky heuristics. Thanks Marc Abramowitz for tests
  3175. and initial fixing approaches in this area.
  3176. - fix issue #479: properly handle nose/unittest(2) SkipTest exceptions
  3177. during collection/loading of test modules. Thanks to Marc Schlaich
  3178. for the complete PR.
  3179. - fix issue490: include pytest_load_initial_conftests in documentation
  3180. and improve docstring.
  3181. - fix issue472: clarify that ``pytest.config.getvalue()`` cannot work
  3182. if it's triggered ahead of command line parsing.
  3183. - merge PR123: improved integration with mock.patch decorator on tests.
  3184. - fix issue412: messing with stdout/stderr FD-level streams is now
  3185. captured without crashes.
  3186. - fix issue483: trial/py33 works now properly. Thanks Daniel Grana for PR.
  3187. - improve example for pytest integration with "python setup.py test"
  3188. which now has a generic "-a" or "--pytest-args" option where you
  3189. can pass additional options as a quoted string. Thanks Trevor Bekolay.
  3190. - simplified internal capturing mechanism and made it more robust
  3191. against tests or setups changing FD1/FD2, also better integrated
  3192. now with pytest.pdb() in single tests.
  3193. - improvements to pytest's own test-suite leakage detection, courtesy of PRs
  3194. from Marc Abramowitz
  3195. - fix issue492: avoid leak in test_writeorg. Thanks Marc Abramowitz.
  3196. - fix issue493: don't run tests in doc directory with ``python setup.py test``
  3197. (use tox -e doctesting for that)
  3198. - fix issue486: better reporting and handling of early conftest loading failures
  3199. - some cleanup and simplification of internal conftest handling.
  3200. - work a bit harder to break reference cycles when catching exceptions.
  3201. Thanks Jurko Gospodnetic.
  3202. - fix issue443: fix skip examples to use proper comparison. Thanks Alex
  3203. Groenholm.
  3204. - support nose-style ``__test__`` attribute on modules, classes and
  3205. functions, including unittest-style Classes. If set to False, the
  3206. test will not be collected.
  3207. - fix issue512: show "<notset>" for arguments which might not be set
  3208. in monkeypatch plugin. Improves output in documentation.
  3209. 2.5.2 (2014-01-29)
  3210. ==================
  3211. - fix issue409 -- better interoperate with cx_freeze by not
  3212. trying to import from collections.abc which causes problems
  3213. for py27/cx_freeze. Thanks Wolfgang L. for reporting and tracking it down.
  3214. - fixed docs and code to use "pytest" instead of "py.test" almost everywhere.
  3215. Thanks Jurko Gospodnetic for the complete PR.
  3216. - fix issue425: mention at end of "py.test -h" that --markers
  3217. and --fixtures work according to specified test path (or current dir)
  3218. - fix issue413: exceptions with unicode attributes are now printed
  3219. correctly also on python2 and with pytest-xdist runs. (the fix
  3220. requires py-1.4.20)
  3221. - copy, cleanup and integrate py.io capture
  3222. from pylib 1.4.20.dev2 (rev 13d9af95547e)
  3223. - address issue416: clarify docs as to conftest.py loading semantics
  3224. - fix issue429: comparing byte strings with non-ascii chars in assert
  3225. expressions now work better. Thanks Floris Bruynooghe.
  3226. - make capfd/capsys.capture private, its unused and shouldn't be exposed
  3227. 2.5.1 (2013-12-17)
  3228. ==================
  3229. - merge new documentation styling PR from Tobias Bieniek.
  3230. - fix issue403: allow parametrize of multiple same-name functions within
  3231. a collection node. Thanks Andreas Kloeckner and Alex Gaynor for reporting
  3232. and analysis.
  3233. - Allow parameterized fixtures to specify the ID of the parameters by
  3234. adding an ids argument to pytest.fixture() and pytest.yield_fixture().
  3235. Thanks Floris Bruynooghe.
  3236. - fix issue404 by always using the binary xml escape in the junitxml
  3237. plugin. Thanks Ronny Pfannschmidt.
  3238. - fix issue407: fix addoption docstring to point to argparse instead of
  3239. optparse. Thanks Daniel D. Wright.
  3240. 2.5.0 (2013-12-12)
  3241. ==================
  3242. - dropped python2.5 from automated release testing of pytest itself
  3243. which means it's probably going to break soon (but still works
  3244. with this release we believe).
  3245. - simplified and fixed implementation for calling finalizers when
  3246. parametrized fixtures or function arguments are involved. finalization
  3247. is now performed lazily at setup time instead of in the "teardown phase".
  3248. While this might sound odd at first, it helps to ensure that we are
  3249. correctly handling setup/teardown even in complex code. User-level code
  3250. should not be affected unless it's implementing the pytest_runtest_teardown
  3251. hook and expecting certain fixture instances are torn down within (very
  3252. unlikely and would have been unreliable anyway).
  3253. - PR90: add --color=yes|no|auto option to force terminal coloring
  3254. mode ("auto" is default). Thanks Marc Abramowitz.
  3255. - fix issue319 - correctly show unicode in assertion errors. Many
  3256. thanks to Floris Bruynooghe for the complete PR. Also means
  3257. we depend on py>=1.4.19 now.
  3258. - fix issue396 - correctly sort and finalize class-scoped parametrized
  3259. tests independently from number of methods on the class.
  3260. - refix issue323 in a better way -- parametrization should now never
  3261. cause Runtime Recursion errors because the underlying algorithm
  3262. for re-ordering tests per-scope/per-fixture is not recursive
  3263. anymore (it was tail-call recursive before which could lead
  3264. to problems for more than >966 non-function scoped parameters).
  3265. - fix issue290 - there is preliminary support now for parametrizing
  3266. with repeated same values (sometimes useful to test if calling
  3267. a second time works as with the first time).
  3268. - close issue240 - document precisely how pytest module importing
  3269. works, discuss the two common test directory layouts, and how it
  3270. interacts with PEP420-namespace packages.
  3271. - fix issue246 fix finalizer order to be LIFO on independent fixtures
  3272. depending on a parametrized higher-than-function scoped fixture.
  3273. (was quite some effort so please bear with the complexity of this sentence :)
  3274. Thanks Ralph Schmitt for the precise failure example.
  3275. - fix issue244 by implementing special index for parameters to only use
  3276. indices for paramentrized test ids
  3277. - fix issue287 by running all finalizers but saving the exception
  3278. from the first failing finalizer and re-raising it so teardown will
  3279. still have failed. We reraise the first failing exception because
  3280. it might be the cause for other finalizers to fail.
  3281. - fix ordering when mock.patch or other standard decorator-wrappings
  3282. are used with test methods. This fixues issue346 and should
  3283. help with random "xdist" collection failures. Thanks to
  3284. Ronny Pfannschmidt and Donald Stufft for helping to isolate it.
  3285. - fix issue357 - special case "-k" expressions to allow for
  3286. filtering with simple strings that are not valid python expressions.
  3287. Examples: "-k 1.3" matches all tests parametrized with 1.3.
  3288. "-k None" filters all tests that have "None" in their name
  3289. and conversely "-k 'not None'".
  3290. Previously these examples would raise syntax errors.
  3291. - fix issue384 by removing the trial support code
  3292. since the unittest compat enhancements allow
  3293. trial to handle it on its own
  3294. - don't hide an ImportError when importing a plugin produces one.
  3295. fixes issue375.
  3296. - fix issue275 - allow usefixtures and autouse fixtures
  3297. for running doctest text files.
  3298. - fix issue380 by making --resultlog only rely on longrepr instead
  3299. of the "reprcrash" attribute which only exists sometimes.
  3300. - address issue122: allow @pytest.fixture(params=iterator) by exploding
  3301. into a list early on.
  3302. - fix pexpect-3.0 compatibility for pytest's own tests.
  3303. (fixes issue386)
  3304. - allow nested parametrize-value markers, thanks James Lan for the PR.
  3305. - fix unicode handling with new monkeypatch.setattr(import_path, value)
  3306. API. Thanks Rob Dennis. Fixes issue371.
  3307. - fix unicode handling with junitxml, fixes issue368.
  3308. - In assertion rewriting mode on Python 2, fix the detection of coding
  3309. cookies. See issue #330.
  3310. - make "--runxfail" turn imperative pytest.xfail calls into no ops
  3311. (it already did neutralize pytest.mark.xfail markers)
  3312. - refine pytest / pkg_resources interactions: The AssertionRewritingHook
  3313. PEP302 compliant loader now registers itself with setuptools/pkg_resources
  3314. properly so that the pkg_resources.resource_stream method works properly.
  3315. Fixes issue366. Thanks for the investigations and full PR to Jason R. Coombs.
  3316. - pytestconfig fixture is now session-scoped as it is the same object during the
  3317. whole test run. Fixes issue370.
  3318. - avoid one surprising case of marker malfunction/confusion::
  3319. @pytest.mark.some(lambda arg: ...)
  3320. def test_function():
  3321. would not work correctly because pytest assumes @pytest.mark.some
  3322. gets a function to be decorated already. We now at least detect if this
  3323. arg is a lambda and thus the example will work. Thanks Alex Gaynor
  3324. for bringing it up.
  3325. - xfail a test on pypy that checks wrong encoding/ascii (pypy does
  3326. not error out). fixes issue385.
  3327. - internally make varnames() deal with classes's __init__,
  3328. although it's not needed by pytest itself atm. Also
  3329. fix caching. Fixes issue376.
  3330. - fix issue221 - handle importing of namespace-package with no
  3331. __init__.py properly.
  3332. - refactor internal FixtureRequest handling to avoid monkeypatching.
  3333. One of the positive user-facing effects is that the "request" object
  3334. can now be used in closures.
  3335. - fixed version comparison in pytest.importskip(modname, minverstring)
  3336. - fix issue377 by clarifying in the nose-compat docs that pytest
  3337. does not duplicate the unittest-API into the "plain" namespace.
  3338. - fix verbose reporting for @mock'd test functions
  3339. 2.4.2 (2013-10-04)
  3340. ==================
  3341. - on Windows require colorama and a newer py lib so that py.io.TerminalWriter()
  3342. now uses colorama instead of its own ctypes hacks. (fixes issue365)
  3343. thanks Paul Moore for bringing it up.
  3344. - fix "-k" matching of tests where "repr" and "attr" and other names would
  3345. cause wrong matches because of an internal implementation quirk
  3346. (don't ask) which is now properly implemented. fixes issue345.
  3347. - avoid tmpdir fixture to create too long filenames especially
  3348. when parametrization is used (issue354)
  3349. - fix pytest-pep8 and pytest-flakes / pytest interactions
  3350. (collection names in mark plugin was assuming an item always
  3351. has a function which is not true for those plugins etc.)
  3352. Thanks Andi Zeidler.
  3353. - introduce node.get_marker/node.add_marker API for plugins
  3354. like pytest-pep8 and pytest-flakes to avoid the messy
  3355. details of the node.keywords pseudo-dicts. Adapted
  3356. docs.
  3357. - remove attempt to "dup" stdout at startup as it's icky.
  3358. the normal capturing should catch enough possibilities
  3359. of tests messing up standard FDs.
  3360. - add pluginmanager.do_configure(config) as a link to
  3361. config.do_configure() for plugin-compatibility
  3362. 2.4.1 (2013-10-02)
  3363. ==================
  3364. - When using parser.addoption() unicode arguments to the
  3365. "type" keyword should also be converted to the respective types.
  3366. thanks Floris Bruynooghe, @dnozay. (fixes issue360 and issue362)
  3367. - fix dotted filename completion when using argcomplete
  3368. thanks Anthon van der Neuth. (fixes issue361)
  3369. - fix regression when a 1-tuple ("arg",) is used for specifying
  3370. parametrization (the values of the parametrization were passed
  3371. nested in a tuple). Thanks Donald Stufft.
  3372. - merge doc typo fixes, thanks Andy Dirnberger
  3373. 2.4
  3374. ===
  3375. known incompatibilities:
  3376. - if calling --genscript from python2.7 or above, you only get a
  3377. standalone script which works on python2.7 or above. Use Python2.6
  3378. to also get a python2.5 compatible version.
  3379. - all xunit-style teardown methods (nose-style, pytest-style,
  3380. unittest-style) will not be called if the corresponding setup method failed,
  3381. see issue322 below.
  3382. - the pytest_plugin_unregister hook wasn't ever properly called
  3383. and there is no known implementation of the hook - so it got removed.
  3384. - pytest.fixture-decorated functions cannot be generators (i.e. use
  3385. yield) anymore. This change might be reversed in 2.4.1 if it causes
  3386. unforeseen real-life issues. However, you can always write and return
  3387. an inner function/generator and change the fixture consumer to iterate
  3388. over the returned generator. This change was done in lieu of the new
  3389. ``pytest.yield_fixture`` decorator, see below.
  3390. new features:
  3391. - experimentally introduce a new ``pytest.yield_fixture`` decorator
  3392. which accepts exactly the same parameters as pytest.fixture but
  3393. mandates a ``yield`` statement instead of a ``return statement`` from
  3394. fixture functions. This allows direct integration with "with-style"
  3395. context managers in fixture functions and generally avoids registering
  3396. of finalization callbacks in favour of treating the "after-yield" as
  3397. teardown code. Thanks Andreas Pelme, Vladimir Keleshev, Floris
  3398. Bruynooghe, Ronny Pfannschmidt and many others for discussions.
  3399. - allow boolean expression directly with skipif/xfail
  3400. if a "reason" is also specified. Rework skipping documentation
  3401. to recommend "condition as booleans" because it prevents surprises
  3402. when importing markers between modules. Specifying conditions
  3403. as strings will remain fully supported.
  3404. - reporting: color the last line red or green depending if
  3405. failures/errors occurred or everything passed. thanks Christian
  3406. Theunert.
  3407. - make "import pdb ; pdb.set_trace()" work natively wrt capturing (no
  3408. "-s" needed anymore), making ``pytest.set_trace()`` a mere shortcut.
  3409. - fix issue181: --pdb now also works on collect errors (and
  3410. on internal errors) . This was implemented by a slight internal
  3411. refactoring and the introduction of a new hook
  3412. ``pytest_exception_interact`` hook (see next item).
  3413. - fix issue341: introduce new experimental hook for IDEs/terminals to
  3414. intercept debugging: ``pytest_exception_interact(node, call, report)``.
  3415. - new monkeypatch.setattr() variant to provide a shorter
  3416. invocation for patching out classes/functions from modules:
  3417. monkeypatch.setattr("requests.get", myfunc)
  3418. will replace the "get" function of the "requests" module with ``myfunc``.
  3419. - fix issue322: tearDownClass is not run if setUpClass failed. Thanks
  3420. Mathieu Agopian for the initial fix. Also make all of pytest/nose
  3421. finalizer mimic the same generic behaviour: if a setupX exists and
  3422. fails, don't run teardownX. This internally introduces a new method
  3423. "node.addfinalizer()" helper which can only be called during the setup
  3424. phase of a node.
  3425. - simplify pytest.mark.parametrize() signature: allow to pass a
  3426. CSV-separated string to specify argnames. For example:
  3427. ``pytest.mark.parametrize("input,expected", [(1,2), (2,3)])``
  3428. works as well as the previous:
  3429. ``pytest.mark.parametrize(("input", "expected"), ...)``.
  3430. - add support for setUpModule/tearDownModule detection, thanks Brian Okken.
  3431. - integrate tab-completion on options through use of "argcomplete".
  3432. Thanks Anthon van der Neut for the PR.
  3433. - change option names to be hyphen-separated long options but keep the
  3434. old spelling backward compatible. py.test -h will only show the
  3435. hyphenated version, for example "--collect-only" but "--collectonly"
  3436. will remain valid as well (for backward-compat reasons). Many thanks to
  3437. Anthon van der Neut for the implementation and to Hynek Schlawack for
  3438. pushing us.
  3439. - fix issue 308 - allow to mark/xfail/skip individual parameter sets
  3440. when parametrizing. Thanks Brianna Laugher.
  3441. - call new experimental pytest_load_initial_conftests hook to allow
  3442. 3rd party plugins to do something before a conftest is loaded.
  3443. Bug fixes:
  3444. - fix issue358 - capturing options are now parsed more properly
  3445. by using a new parser.parse_known_args method.
  3446. - pytest now uses argparse instead of optparse (thanks Anthon) which
  3447. means that "argparse" is added as a dependency if installing into python2.6
  3448. environments or below.
  3449. - fix issue333: fix a case of bad unittest/pytest hook interaction.
  3450. - PR27: correctly handle nose.SkipTest during collection. Thanks
  3451. Antonio Cuni, Ronny Pfannschmidt.
  3452. - fix issue355: junitxml puts name="pytest" attribute to testsuite tag.
  3453. - fix issue336: autouse fixture in plugins should work again.
  3454. - fix issue279: improve object comparisons on assertion failure
  3455. for standard datatypes and recognise collections.abc. Thanks to
  3456. Brianna Laugher and Mathieu Agopian.
  3457. - fix issue317: assertion rewriter support for the is_package method
  3458. - fix issue335: document py.code.ExceptionInfo() object returned
  3459. from pytest.raises(), thanks Mathieu Agopian.
  3460. - remove implicit distribute_setup support from setup.py.
  3461. - fix issue305: ignore any problems when writing pyc files.
  3462. - SO-17664702: call fixture finalizers even if the fixture function
  3463. partially failed (finalizers would not always be called before)
  3464. - fix issue320 - fix class scope for fixtures when mixed with
  3465. module-level functions. Thanks Anatloy Bubenkoff.
  3466. - you can specify "-q" or "-qq" to get different levels of "quieter"
  3467. reporting (thanks Katarzyna Jachim)
  3468. - fix issue300 - Fix order of conftest loading when starting py.test
  3469. in a subdirectory.
  3470. - fix issue323 - sorting of many module-scoped arg parametrizations
  3471. - make sessionfinish hooks execute with the same cwd-context as at
  3472. session start (helps fix plugin behaviour which write output files
  3473. with relative path such as pytest-cov)
  3474. - fix issue316 - properly reference collection hooks in docs
  3475. - fix issue 306 - cleanup of -k/-m options to only match markers/test
  3476. names/keywords respectively. Thanks Wouter van Ackooy.
  3477. - improved doctest counting for doctests in python modules --
  3478. files without any doctest items will not show up anymore
  3479. and doctest examples are counted as separate test items.
  3480. thanks Danilo Bellini.
  3481. - fix issue245 by depending on the released py-1.4.14
  3482. which fixes py.io.dupfile to work with files with no
  3483. mode. Thanks Jason R. Coombs.
  3484. - fix junitxml generation when test output contains control characters,
  3485. addressing issue267, thanks Jaap Broekhuizen
  3486. - fix issue338: honor --tb style for setup/teardown errors as well. Thanks Maho.
  3487. - fix issue307 - use yaml.safe_load in example, thanks Mark Eichin.
  3488. - better parametrize error messages, thanks Brianna Laugher
  3489. - pytest_terminal_summary(terminalreporter) hooks can now use
  3490. ".section(title)" and ".line(msg)" methods to print extra
  3491. information at the end of a test run.
  3492. 2.3.5 (2013-04-30)
  3493. ==================
  3494. - fix issue169: respect --tb=style with setup/teardown errors as well.
  3495. - never consider a fixture function for test function collection
  3496. - allow re-running of test items / helps to fix pytest-reruntests plugin
  3497. and also help to keep less fixture/resource references alive
  3498. - put captured stdout/stderr into junitxml output even for passing tests
  3499. (thanks Adam Goucher)
  3500. - Issue 265 - integrate nose setup/teardown with setupstate
  3501. so it doesn't try to teardown if it did not setup
  3502. - issue 271 - don't write junitxml on slave nodes
  3503. - Issue 274 - don't try to show full doctest example
  3504. when doctest does not know the example location
  3505. - issue 280 - disable assertion rewriting on buggy CPython 2.6.0
  3506. - inject "getfixture()" helper to retrieve fixtures from doctests,
  3507. thanks Andreas Zeidler
  3508. - issue 259 - when assertion rewriting, be consistent with the default
  3509. source encoding of ASCII on Python 2
  3510. - issue 251 - report a skip instead of ignoring classes with init
  3511. - issue250 unicode/str mixes in parametrization names and values now works
  3512. - issue257, assertion-triggered compilation of source ending in a
  3513. comment line doesn't blow up in python2.5 (fixed through py>=1.4.13.dev6)
  3514. - fix --genscript option to generate standalone scripts that also
  3515. work with python3.3 (importer ordering)
  3516. - issue171 - in assertion rewriting, show the repr of some
  3517. global variables
  3518. - fix option help for "-k"
  3519. - move long description of distribution into README.rst
  3520. - improve docstring for metafunc.parametrize()
  3521. - fix bug where using capsys with pytest.set_trace() in a test
  3522. function would break when looking at capsys.readouterr()
  3523. - allow to specify prefixes starting with "_" when
  3524. customizing python_functions test discovery. (thanks Graham Horler)
  3525. - improve PYTEST_DEBUG tracing output by putting
  3526. extra data on a new lines with additional indent
  3527. - ensure OutcomeExceptions like skip/fail have initialized exception attributes
  3528. - issue 260 - don't use nose special setup on plain unittest cases
  3529. - fix issue134 - print the collect errors that prevent running specified test items
  3530. - fix issue266 - accept unicode in MarkEvaluator expressions
  3531. 2.3.4 (2012-11-20)
  3532. ==================
  3533. - yielded test functions will now have autouse-fixtures active but
  3534. cannot accept fixtures as funcargs - it's anyway recommended to
  3535. rather use the post-2.0 parametrize features instead of yield, see:
  3536. http://pytest.org/latest/example/parametrize.html
  3537. - fix autouse-issue where autouse-fixtures would not be discovered
  3538. if defined in an a/conftest.py file and tests in a/tests/test_some.py
  3539. - fix issue226 - LIFO ordering for fixture teardowns
  3540. - fix issue224 - invocations with >256 char arguments now work
  3541. - fix issue91 - add/discuss package/directory level setups in example
  3542. - allow to dynamically define markers via
  3543. item.keywords[...]=assignment integrating with "-m" option
  3544. - make "-k" accept an expressions the same as with "-m" so that one
  3545. can write: -k "name1 or name2" etc. This is a slight incompatibility
  3546. if you used special syntax like "TestClass.test_method" which you now
  3547. need to write as -k "TestClass and test_method" to match a certain
  3548. method in a certain test class.
  3549. 2.3.3 (2012-11-06)
  3550. ==================
  3551. - fix issue214 - parse modules that contain special objects like e. g.
  3552. flask's request object which blows up on getattr access if no request
  3553. is active. thanks Thomas Waldmann.
  3554. - fix issue213 - allow to parametrize with values like numpy arrays that
  3555. do not support an __eq__ operator
  3556. - fix issue215 - split test_python.org into multiple files
  3557. - fix issue148 - @unittest.skip on classes is now recognized and avoids
  3558. calling setUpClass/tearDownClass, thanks Pavel Repin
  3559. - fix issue209 - reintroduce python2.4 support by depending on newer
  3560. pylib which re-introduced statement-finding for pre-AST interpreters
  3561. - nose support: only call setup if it's a callable, thanks Andrew
  3562. Taumoefolau
  3563. - fix issue219 - add py2.4-3.3 classifiers to TROVE list
  3564. - in tracebacks *,** arg values are now shown next to normal arguments
  3565. (thanks Manuel Jacob)
  3566. - fix issue217 - support mock.patch with pytest's fixtures - note that
  3567. you need either mock-1.0.1 or the python3.3 builtin unittest.mock.
  3568. - fix issue127 - improve documentation for pytest_addoption() and
  3569. add a ``config.getoption(name)`` helper function for consistency.
  3570. 2.3.2 (2012-10-25)
  3571. ==================
  3572. - fix issue208 and fix issue29 use new py version to avoid long pauses
  3573. when printing tracebacks in long modules
  3574. - fix issue205 - conftests in subdirs customizing
  3575. pytest_pycollect_makemodule and pytest_pycollect_makeitem
  3576. now work properly
  3577. - fix teardown-ordering for parametrized setups
  3578. - fix issue127 - better documentation for pytest_addoption
  3579. and related objects.
  3580. - fix unittest behaviour: TestCase.runtest only called if there are
  3581. test methods defined
  3582. - improve trial support: don't collect its empty
  3583. unittest.TestCase.runTest() method
  3584. - "python setup.py test" now works with pytest itself
  3585. - fix/improve internal/packaging related bits:
  3586. - exception message check of test_nose.py now passes on python33 as well
  3587. - issue206 - fix test_assertrewrite.py to work when a global
  3588. PYTHONDONTWRITEBYTECODE=1 is present
  3589. - add tox.ini to pytest distribution so that ignore-dirs and others config
  3590. bits are properly distributed for maintainers who run pytest-own tests
  3591. 2.3.1 (2012-10-20)
  3592. ==================
  3593. - fix issue202 - fix regression: using "self" from fixture functions now
  3594. works as expected (it's the same "self" instance that a test method
  3595. which uses the fixture sees)
  3596. - skip pexpect using tests (test_pdb.py mostly) on freebsd* systems
  3597. due to pexpect not supporting it properly (hanging)
  3598. - link to web pages from --markers output which provides help for
  3599. pytest.mark.* usage.
  3600. 2.3.0 (2012-10-19)
  3601. ==================
  3602. - fix issue202 - better automatic names for parametrized test functions
  3603. - fix issue139 - introduce @pytest.fixture which allows direct scoping
  3604. and parametrization of funcarg factories.
  3605. - fix issue198 - conftest fixtures were not found on windows32 in some
  3606. circumstances with nested directory structures due to path manipulation issues
  3607. - fix issue193 skip test functions with were parametrized with empty
  3608. parameter sets
  3609. - fix python3.3 compat, mostly reporting bits that previously depended
  3610. on dict ordering
  3611. - introduce re-ordering of tests by resource and parametrization setup
  3612. which takes precedence to the usual file-ordering
  3613. - fix issue185 monkeypatching time.time does not cause pytest to fail
  3614. - fix issue172 duplicate call of pytest.fixture decoratored setup_module
  3615. functions
  3616. - fix junitxml=path construction so that if tests change the
  3617. current working directory and the path is a relative path
  3618. it is constructed correctly from the original current working dir.
  3619. - fix "python setup.py test" example to cause a proper "errno" return
  3620. - fix issue165 - fix broken doc links and mention stackoverflow for FAQ
  3621. - catch unicode-issues when writing failure representations
  3622. to terminal to prevent the whole session from crashing
  3623. - fix xfail/skip confusion: a skip-mark or an imperative pytest.skip
  3624. will now take precedence before xfail-markers because we
  3625. can't determine xfail/xpass status in case of a skip. see also:
  3626. http://stackoverflow.com/questions/11105828/in-py-test-when-i-explicitly-skip-a-test-that-is-marked-as-xfail-how-can-i-get
  3627. - always report installed 3rd party plugins in the header of a test run
  3628. - fix issue160: a failing setup of an xfail-marked tests should
  3629. be reported as xfail (not xpass)
  3630. - fix issue128: show captured output when capsys/capfd are used
  3631. - fix issue179: properly show the dependency chain of factories
  3632. - pluginmanager.register(...) now raises ValueError if the
  3633. plugin has been already registered or the name is taken
  3634. - fix issue159: improve http://pytest.org/latest/faq.html
  3635. especially with respect to the "magic" history, also mention
  3636. pytest-django, trial and unittest integration.
  3637. - make request.keywords and node.keywords writable. All descendant
  3638. collection nodes will see keyword values. Keywords are dictionaries
  3639. containing markers and other info.
  3640. - fix issue 178: xml binary escapes are now wrapped in py.xml.raw
  3641. - fix issue 176: correctly catch the builtin AssertionError
  3642. even when we replaced AssertionError with a subclass on the
  3643. python level
  3644. - factory discovery no longer fails with magic global callables
  3645. that provide no sane __code__ object (mock.call for example)
  3646. - fix issue 182: testdir.inprocess_run now considers passed plugins
  3647. - fix issue 188: ensure sys.exc_info is clear on python2
  3648. before calling into a test
  3649. - fix issue 191: add unittest TestCase runTest method support
  3650. - fix issue 156: monkeypatch correctly handles class level descriptors
  3651. - reporting refinements:
  3652. - pytest_report_header now receives a "startdir" so that
  3653. you can use startdir.bestrelpath(yourpath) to show
  3654. nice relative path
  3655. - allow plugins to implement both pytest_report_header and
  3656. pytest_sessionstart (sessionstart is invoked first).
  3657. - don't show deselected reason line if there is none
  3658. - py.test -vv will show all of assert comparisons instead of truncating
  3659. 2.2.4 (2012-05-22)
  3660. ==================
  3661. - fix error message for rewritten assertions involving the % operator
  3662. - fix issue 126: correctly match all invalid xml characters for junitxml
  3663. binary escape
  3664. - fix issue with unittest: now @unittest.expectedFailure markers should
  3665. be processed correctly (you can also use @pytest.mark markers)
  3666. - document integration with the extended distribute/setuptools test commands
  3667. - fix issue 140: properly get the real functions
  3668. of bound classmethods for setup/teardown_class
  3669. - fix issue #141: switch from the deceased paste.pocoo.org to bpaste.net
  3670. - fix issue #143: call unconfigure/sessionfinish always when
  3671. configure/sessionstart where called
  3672. - fix issue #144: better mangle test ids to junitxml classnames
  3673. - upgrade distribute_setup.py to 0.6.27
  3674. 2.2.3 (2012-02-05)
  3675. ==================
  3676. - fix uploaded package to only include necessary files
  3677. 2.2.2 (2012-02-05)
  3678. ==================
  3679. - fix issue101: wrong args to unittest.TestCase test function now
  3680. produce better output
  3681. - fix issue102: report more useful errors and hints for when a
  3682. test directory was renamed and some pyc/__pycache__ remain
  3683. - fix issue106: allow parametrize to be applied multiple times
  3684. e.g. from module, class and at function level.
  3685. - fix issue107: actually perform session scope finalization
  3686. - don't check in parametrize if indirect parameters are funcarg names
  3687. - add chdir method to monkeypatch funcarg
  3688. - fix crash resulting from calling monkeypatch undo a second time
  3689. - fix issue115: make --collectonly robust against early failure
  3690. (missing files/directories)
  3691. - "-qq --collectonly" now shows only files and the number of tests in them
  3692. - "-q --collectonly" now shows test ids
  3693. - allow adding of attributes to test reports such that it also works
  3694. with distributed testing (no upgrade of pytest-xdist needed)
  3695. 2.2.1 (2011-12-16)
  3696. ==================
  3697. - fix issue99 (in pytest and py) internallerrors with resultlog now
  3698. produce better output - fixed by normalizing pytest_internalerror
  3699. input arguments.
  3700. - fix issue97 / traceback issues (in pytest and py) improve traceback output
  3701. in conjunction with jinja2 and cython which hack tracebacks
  3702. - fix issue93 (in pytest and pytest-xdist) avoid "delayed teardowns":
  3703. the final test in a test node will now run its teardown directly
  3704. instead of waiting for the end of the session. Thanks Dave Hunt for
  3705. the good reporting and feedback. The pytest_runtest_protocol as well
  3706. as the pytest_runtest_teardown hooks now have "nextitem" available
  3707. which will be None indicating the end of the test run.
  3708. - fix collection crash due to unknown-source collected items, thanks
  3709. to Ralf Schmitt (fixed by depending on a more recent pylib)
  3710. 2.2.0 (2011-11-18)
  3711. ==================
  3712. - fix issue90: introduce eager tearing down of test items so that
  3713. teardown function are called earlier.
  3714. - add an all-powerful metafunc.parametrize function which allows to
  3715. parametrize test function arguments in multiple steps and therefore
  3716. from independent plugins and places.
  3717. - add a @pytest.mark.parametrize helper which allows to easily
  3718. call a test function with different argument values
  3719. - Add examples to the "parametrize" example page, including a quick port
  3720. of Test scenarios and the new parametrize function and decorator.
  3721. - introduce registration for "pytest.mark.*" helpers via ini-files
  3722. or through plugin hooks. Also introduce a "--strict" option which
  3723. will treat unregistered markers as errors
  3724. allowing to avoid typos and maintain a well described set of markers
  3725. for your test suite. See exaples at http://pytest.org/latest/mark.html
  3726. and its links.
  3727. - issue50: introduce "-m marker" option to select tests based on markers
  3728. (this is a stricter and more predictable version of '-k' in that "-m"
  3729. only matches complete markers and has more obvious rules for and/or
  3730. semantics.
  3731. - new feature to help optimizing the speed of your tests:
  3732. --durations=N option for displaying N slowest test calls
  3733. and setup/teardown methods.
  3734. - fix issue87: --pastebin now works with python3
  3735. - fix issue89: --pdb with unexpected exceptions in doctest work more sensibly
  3736. - fix and cleanup pytest's own test suite to not leak FDs
  3737. - fix issue83: link to generated funcarg list
  3738. - fix issue74: pyarg module names are now checked against imp.find_module false positives
  3739. - fix compatibility with twisted/trial-11.1.0 use cases
  3740. - simplify Node.listchain
  3741. - simplify junitxml output code by relying on py.xml
  3742. - add support for skip properties on unittest classes and functions
  3743. 2.1.3 (2011-10-18)
  3744. ==================
  3745. - fix issue79: assertion rewriting failed on some comparisons in boolops
  3746. - correctly handle zero length arguments (a la pytest '')
  3747. - fix issue67 / junitxml now contains correct test durations, thanks ronny
  3748. - fix issue75 / skipping test failure on jython
  3749. - fix issue77 / Allow assertrepr_compare hook to apply to a subset of tests
  3750. 2.1.2 (2011-09-24)
  3751. ==================
  3752. - fix assertion rewriting on files with windows newlines on some Python versions
  3753. - refine test discovery by package/module name (--pyargs), thanks Florian Mayer
  3754. - fix issue69 / assertion rewriting fixed on some boolean operations
  3755. - fix issue68 / packages now work with assertion rewriting
  3756. - fix issue66: use different assertion rewriting caches when the -O option is passed
  3757. - don't try assertion rewriting on Jython, use reinterp
  3758. 2.1.1
  3759. =====
  3760. - fix issue64 / pytest.set_trace now works within pytest_generate_tests hooks
  3761. - fix issue60 / fix error conditions involving the creation of __pycache__
  3762. - fix issue63 / assertion rewriting on inserts involving strings containing '%'
  3763. - fix assertion rewriting on calls with a ** arg
  3764. - don't cache rewritten modules if bytecode generation is disabled
  3765. - fix assertion rewriting in read-only directories
  3766. - fix issue59: provide system-out/err tags for junitxml output
  3767. - fix issue61: assertion rewriting on boolean operations with 3 or more operands
  3768. - you can now build a man page with "cd doc ; make man"
  3769. 2.1.0 (2011-07-09)
  3770. ==================
  3771. - fix issue53 call nosestyle setup functions with correct ordering
  3772. - fix issue58 and issue59: new assertion code fixes
  3773. - merge Benjamin's assertionrewrite branch: now assertions
  3774. for test modules on python 2.6 and above are done by rewriting
  3775. the AST and saving the pyc file before the test module is imported.
  3776. see doc/assert.txt for more info.
  3777. - fix issue43: improve doctests with better traceback reporting on
  3778. unexpected exceptions
  3779. - fix issue47: timing output in junitxml for test cases is now correct
  3780. - fix issue48: typo in MarkInfo repr leading to exception
  3781. - fix issue49: avoid confusing error when initizaliation partially fails
  3782. - fix issue44: env/username expansion for junitxml file path
  3783. - show releaselevel information in test runs for pypy
  3784. - reworked doc pages for better navigation and PDF generation
  3785. - report KeyboardInterrupt even if interrupted during session startup
  3786. - fix issue 35 - provide PDF doc version and download link from index page
  3787. 2.0.3 (2011-05-11)
  3788. ==================
  3789. - fix issue38: nicer tracebacks on calls to hooks, particularly early
  3790. configure/sessionstart ones
  3791. - fix missing skip reason/meta information in junitxml files, reported
  3792. via http://lists.idyll.org/pipermail/testing-in-python/2011-March/003928.html
  3793. - fix issue34: avoid collection failure with "test" prefixed classes
  3794. deriving from object.
  3795. - don't require zlib (and other libs) for genscript plugin without
  3796. --genscript actually being used.
  3797. - speed up skips (by not doing a full traceback representation
  3798. internally)
  3799. - fix issue37: avoid invalid characters in junitxml's output
  3800. 2.0.2 (2011-03-09)
  3801. ==================
  3802. - tackle issue32 - speed up test runs of very quick test functions
  3803. by reducing the relative overhead
  3804. - fix issue30 - extended xfail/skipif handling and improved reporting.
  3805. If you have a syntax error in your skip/xfail
  3806. expressions you now get nice error reports.
  3807. Also you can now access module globals from xfail/skipif
  3808. expressions so that this for example works now::
  3809. import pytest
  3810. import mymodule
  3811. @pytest.mark.skipif("mymodule.__version__[0] == "1")
  3812. def test_function():
  3813. pass
  3814. This will not run the test function if the module's version string
  3815. does not start with a "1". Note that specifying a string instead
  3816. of a boolean expressions allows py.test to report meaningful information
  3817. when summarizing a test run as to what conditions lead to skipping
  3818. (or xfail-ing) tests.
  3819. - fix issue28 - setup_method and pytest_generate_tests work together
  3820. The setup_method fixture method now gets called also for
  3821. test function invocations generated from the pytest_generate_tests
  3822. hook.
  3823. - fix issue27 - collectonly and keyword-selection (-k) now work together
  3824. Also, if you do "py.test --collectonly -q" you now get a flat list
  3825. of test ids that you can use to paste to the py.test commandline
  3826. in order to execute a particular test.
  3827. - fix issue25 avoid reported problems with --pdb and python3.2/encodings output
  3828. - fix issue23 - tmpdir argument now works on Python3.2 and WindowsXP
  3829. Starting with Python3.2 os.symlink may be supported. By requiring
  3830. a newer py lib version the py.path.local() implementation acknowledges
  3831. this.
  3832. - fixed typos in the docs (thanks Victor Garcia, Brianna Laugher) and particular
  3833. thanks to Laura Creighton who also reviewed parts of the documentation.
  3834. - fix slightly wrong output of verbose progress reporting for classes
  3835. (thanks Amaury)
  3836. - more precise (avoiding of) deprecation warnings for node.Class|Function accesses
  3837. - avoid std unittest assertion helper code in tracebacks (thanks Ronny)
  3838. 2.0.1 (2011-02-07)
  3839. ==================
  3840. - refine and unify initial capturing so that it works nicely
  3841. even if the logging module is used on an early-loaded conftest.py
  3842. file or plugin.
  3843. - allow to omit "()" in test ids to allow for uniform test ids
  3844. as produced by Alfredo's nice pytest.vim plugin.
  3845. - fix issue12 - show plugin versions with "--version" and
  3846. "--traceconfig" and also document how to add extra information
  3847. to reporting test header
  3848. - fix issue17 (import-* reporting issue on python3) by
  3849. requiring py>1.4.0 (1.4.1 is going to include it)
  3850. - fix issue10 (numpy arrays truth checking) by refining
  3851. assertion interpretation in py lib
  3852. - fix issue15: make nose compatibility tests compatible
  3853. with python3 (now that nose-1.0 supports python3)
  3854. - remove somewhat surprising "same-conftest" detection because
  3855. it ignores conftest.py when they appear in several subdirs.
  3856. - improve assertions ("not in"), thanks Floris Bruynooghe
  3857. - improve behaviour/warnings when running on top of "python -OO"
  3858. (assertions and docstrings are turned off, leading to potential
  3859. false positives)
  3860. - introduce a pytest_cmdline_processargs(args) hook
  3861. to allow dynamic computation of command line arguments.
  3862. This fixes a regression because py.test prior to 2.0
  3863. allowed to set command line options from conftest.py
  3864. files which so far pytest-2.0 only allowed from ini-files now.
  3865. - fix issue7: assert failures in doctest modules.
  3866. unexpected failures in doctests will not generally
  3867. show nicer, i.e. within the doctest failing context.
  3868. - fix issue9: setup/teardown functions for an xfail-marked
  3869. test will report as xfail if they fail but report as normally
  3870. passing (not xpassing) if they succeed. This only is true
  3871. for "direct" setup/teardown invocations because teardown_class/
  3872. teardown_module cannot closely relate to a single test.
  3873. - fix issue14: no logging errors at process exit
  3874. - refinements to "collecting" output on non-ttys
  3875. - refine internal plugin registration and --traceconfig output
  3876. - introduce a mechanism to prevent/unregister plugins from the
  3877. command line, see http://pytest.org/plugins.html#cmdunregister
  3878. - activate resultlog plugin by default
  3879. - fix regression wrt yielded tests which due to the
  3880. collection-before-running semantics were not
  3881. setup as with pytest 1.3.4. Note, however, that
  3882. the recommended and much cleaner way to do test
  3883. parametraization remains the "pytest_generate_tests"
  3884. mechanism, see the docs.
  3885. 2.0.0 (2010-11-25)
  3886. ==================
  3887. - pytest-2.0 is now its own package and depends on pylib-2.0
  3888. - new ability: python -m pytest / python -m pytest.main ability
  3889. - new python invocation: pytest.main(args, plugins) to load
  3890. some custom plugins early.
  3891. - try harder to run unittest test suites in a more compatible manner
  3892. by deferring setup/teardown semantics to the unittest package.
  3893. also work harder to run twisted/trial and Django tests which
  3894. should now basically work by default.
  3895. - introduce a new way to set config options via ini-style files,
  3896. by default setup.cfg and tox.ini files are searched. The old
  3897. ways (certain environment variables, dynamic conftest.py reading
  3898. is removed).
  3899. - add a new "-q" option which decreases verbosity and prints a more
  3900. nose/unittest-style "dot" output.
  3901. - fix issue135 - marks now work with unittest test cases as well
  3902. - fix issue126 - introduce py.test.set_trace() to trace execution via
  3903. PDB during the running of tests even if capturing is ongoing.
  3904. - fix issue123 - new "python -m py.test" invocation for py.test
  3905. (requires Python 2.5 or above)
  3906. - fix issue124 - make reporting more resilient against tests opening
  3907. files on filedescriptor 1 (stdout).
  3908. - fix issue109 - sibling conftest.py files will not be loaded.
  3909. (and Directory collectors cannot be customized anymore from a Directory's
  3910. conftest.py - this needs to happen at least one level up).
  3911. - introduce (customizable) assertion failure representations and enhance
  3912. output on assertion failures for comparisons and other cases (Floris Bruynooghe)
  3913. - nose-plugin: pass through type-signature failures in setup/teardown
  3914. functions instead of not calling them (Ed Singleton)
  3915. - remove py.test.collect.Directory (follows from a major refactoring
  3916. and simplification of the collection process)
  3917. - majorly reduce py.test core code, shift function/python testing to own plugin
  3918. - fix issue88 (finding custom test nodes from command line arg)
  3919. - refine 'tmpdir' creation, will now create basenames better associated
  3920. with test names (thanks Ronny)
  3921. - "xpass" (unexpected pass) tests don't cause exitcode!=0
  3922. - fix issue131 / issue60 - importing doctests in __init__ files used as namespace packages
  3923. - fix issue93 stdout/stderr is captured while importing conftest.py
  3924. - fix bug: unittest collected functions now also can have "pytestmark"
  3925. applied at class/module level
  3926. - add ability to use "class" level for cached_setup helper
  3927. - fix strangeness: mark.* objects are now immutable, create new instances
  3928. 1.3.4 (2010-09-14)
  3929. ==================
  3930. - fix issue111: improve install documentation for windows
  3931. - fix issue119: fix custom collectability of __init__.py as a module
  3932. - fix issue116: --doctestmodules work with __init__.py files as well
  3933. - fix issue115: unify internal exception passthrough/catching/GeneratorExit
  3934. - fix issue118: new --tb=native for presenting cpython-standard exceptions
  3935. 1.3.3 (2010-07-30)
  3936. ==================
  3937. - fix issue113: assertion representation problem with triple-quoted strings
  3938. (and possibly other cases)
  3939. - make conftest loading detect that a conftest file with the same
  3940. content was already loaded, avoids surprises in nested directory structures
  3941. which can be produced e.g. by Hudson. It probably removes the need to use
  3942. --confcutdir in most cases.
  3943. - fix terminal coloring for win32
  3944. (thanks Michael Foord for reporting)
  3945. - fix weirdness: make terminal width detection work on stdout instead of stdin
  3946. (thanks Armin Ronacher for reporting)
  3947. - remove trailing whitespace in all py/text distribution files
  3948. 1.3.2 (2010-07-08)
  3949. ==================
  3950. **New features**
  3951. - fix issue103: introduce py.test.raises as context manager, examples::
  3952. with py.test.raises(ZeroDivisionError):
  3953. x = 0
  3954. 1 / x
  3955. with py.test.raises(RuntimeError) as excinfo:
  3956. call_something()
  3957. # you may do extra checks on excinfo.value|type|traceback here
  3958. (thanks Ronny Pfannschmidt)
  3959. - Funcarg factories can now dynamically apply a marker to a
  3960. test invocation. This is for example useful if a factory
  3961. provides parameters to a test which are expected-to-fail::
  3962. def pytest_funcarg__arg(request):
  3963. request.applymarker(py.test.mark.xfail(reason="flaky config"))
  3964. ...
  3965. def test_function(arg):
  3966. ...
  3967. - improved error reporting on collection and import errors. This makes
  3968. use of a more general mechanism, namely that for custom test item/collect
  3969. nodes ``node.repr_failure(excinfo)`` is now uniformly called so that you can
  3970. override it to return a string error representation of your choice
  3971. which is going to be reported as a (red) string.
  3972. - introduce '--junitprefix=STR' option to prepend a prefix
  3973. to all reports in the junitxml file.
  3974. **Bug fixes**
  3975. - make tests and the ``pytest_recwarn`` plugin in particular fully compatible
  3976. to Python2.7 (if you use the ``recwarn`` funcarg warnings will be enabled so that
  3977. you can properly check for their existence in a cross-python manner).
  3978. - refine --pdb: ignore xfailed tests, unify its TB-reporting and
  3979. don't display failures again at the end.
  3980. - fix assertion interpretation with the ** operator (thanks Benjamin Peterson)
  3981. - fix issue105 assignment on the same line as a failing assertion (thanks Benjamin Peterson)
  3982. - fix issue104 proper escaping for test names in junitxml plugin (thanks anonymous)
  3983. - fix issue57 -f|--looponfail to work with xpassing tests (thanks Ronny)
  3984. - fix issue92 collectonly reporter and --pastebin (thanks Benjamin Peterson)
  3985. - fix py.code.compile(source) to generate unique filenames
  3986. - fix assertion re-interp problems on PyPy, by defering code
  3987. compilation to the (overridable) Frame.eval class. (thanks Amaury Forgeot)
  3988. - fix py.path.local.pyimport() to work with directories
  3989. - streamline py.path.local.mkdtemp implementation and usage
  3990. - don't print empty lines when showing junitxml-filename
  3991. - add optional boolean ignore_errors parameter to py.path.local.remove
  3992. - fix terminal writing on win32/python2.4
  3993. - py.process.cmdexec() now tries harder to return properly encoded unicode objects
  3994. on all python versions
  3995. - install plain py.test/py.which scripts also for Jython, this helps to
  3996. get canonical script paths in virtualenv situations
  3997. - make path.bestrelpath(path) return ".", note that when calling
  3998. X.bestrelpath the assumption is that X is a directory.
  3999. - make initial conftest discovery ignore "--" prefixed arguments
  4000. - fix resultlog plugin when used in a multicpu/multihost xdist situation
  4001. (thanks Jakub Gustak)
  4002. - perform distributed testing related reporting in the xdist-plugin
  4003. rather than having dist-related code in the generic py.test
  4004. distribution
  4005. - fix homedir detection on Windows
  4006. - ship distribute_setup.py version 0.6.13
  4007. 1.3.1 (2010-05-25)
  4008. ==================
  4009. **New features**
  4010. - issue91: introduce new py.test.xfail(reason) helper
  4011. to imperatively mark a test as expected to fail. Can
  4012. be used from within setup and test functions. This is
  4013. useful especially for parametrized tests when certain
  4014. configurations are expected-to-fail. In this case the
  4015. declarative approach with the @py.test.mark.xfail cannot
  4016. be used as it would mark all configurations as xfail.
  4017. - issue102: introduce new --maxfail=NUM option to stop
  4018. test runs after NUM failures. This is a generalization
  4019. of the '-x' or '--exitfirst' option which is now equivalent
  4020. to '--maxfail=1'. Both '-x' and '--maxfail' will
  4021. now also print a line near the end indicating the Interruption.
  4022. - issue89: allow py.test.mark decorators to be used on classes
  4023. (class decorators were introduced with python2.6) and
  4024. also allow to have multiple markers applied at class/module level
  4025. by specifying a list.
  4026. - improve and refine letter reporting in the progress bar:
  4027. . pass
  4028. f failed test
  4029. s skipped tests (reminder: use for dependency/platform mismatch only)
  4030. x xfailed test (test that was expected to fail)
  4031. X xpassed test (test that was expected to fail but passed)
  4032. You can use any combination of 'fsxX' with the '-r' extended
  4033. reporting option. The xfail/xpass results will show up as
  4034. skipped tests in the junitxml output - which also fixes
  4035. issue99.
  4036. - make py.test.cmdline.main() return the exitstatus instead of raising
  4037. SystemExit and also allow it to be called multiple times. This of
  4038. course requires that your application and tests are properly teared
  4039. down and don't have global state.
  4040. **Bug Fixes**
  4041. - improved traceback presentation:
  4042. - improved and unified reporting for "--tb=short" option
  4043. - Errors during test module imports are much shorter, (using --tb=short style)
  4044. - raises shows shorter more relevant tracebacks
  4045. - --fulltrace now more systematically makes traces longer / inhibits cutting
  4046. - improve support for raises and other dynamically compiled code by
  4047. manipulating python's linecache.cache instead of the previous
  4048. rather hacky way of creating custom code objects. This makes
  4049. it seemlessly work on Jython and PyPy where it previously didn't.
  4050. - fix issue96: make capturing more resilient against Control-C
  4051. interruptions (involved somewhat substantial refactoring
  4052. to the underlying capturing functionality to avoid race
  4053. conditions).
  4054. - fix chaining of conditional skipif/xfail decorators - so it works now
  4055. as expected to use multiple @py.test.mark.skipif(condition) decorators,
  4056. including specific reporting which of the conditions lead to skipping.
  4057. - fix issue95: late-import zlib so that it's not required
  4058. for general py.test startup.
  4059. - fix issue94: make reporting more robust against bogus source code
  4060. (and internally be more careful when presenting unexpected byte sequences)
  4061. 1.3.0 (2010-05-05)
  4062. ==================
  4063. - deprecate --report option in favour of a new shorter and easier to
  4064. remember -r option: it takes a string argument consisting of any
  4065. combination of 'xfsX' characters. They relate to the single chars
  4066. you see during the dotted progress printing and will print an extra line
  4067. per test at the end of the test run. This extra line indicates the exact
  4068. position or test ID that you directly paste to the py.test cmdline in order
  4069. to re-run a particular test.
  4070. - allow external plugins to register new hooks via the new
  4071. pytest_addhooks(pluginmanager) hook. The new release of
  4072. the pytest-xdist plugin for distributed and looponfailing
  4073. testing requires this feature.
  4074. - add a new pytest_ignore_collect(path, config) hook to allow projects and
  4075. plugins to define exclusion behaviour for their directory structure -
  4076. for example you may define in a conftest.py this method::
  4077. def pytest_ignore_collect(path):
  4078. return path.check(link=1)
  4079. to prevent even a collection try of any tests in symlinked dirs.
  4080. - new pytest_pycollect_makemodule(path, parent) hook for
  4081. allowing customization of the Module collection object for a
  4082. matching test module.
  4083. - extend and refine xfail mechanism:
  4084. ``@py.test.mark.xfail(run=False)`` do not run the decorated test
  4085. ``@py.test.mark.xfail(reason="...")`` prints the reason string in xfail summaries
  4086. specifying ``--runxfail`` on command line virtually ignores xfail markers
  4087. - expose (previously internal) commonly useful methods:
  4088. py.io.get_terminal_with() -> return terminal width
  4089. py.io.ansi_print(...) -> print colored/bold text on linux/win32
  4090. py.io.saferepr(obj) -> return limited representation string
  4091. - expose test outcome related exceptions as py.test.skip.Exception,
  4092. py.test.raises.Exception etc., useful mostly for plugins
  4093. doing special outcome interpretation/tweaking
  4094. - (issue85) fix junitxml plugin to handle tests with non-ascii output
  4095. - fix/refine python3 compatibility (thanks Benjamin Peterson)
  4096. - fixes for making the jython/win32 combination work, note however:
  4097. jython2.5.1/win32 does not provide a command line launcher, see
  4098. http://bugs.jython.org/issue1491 . See pylib install documentation
  4099. for how to work around.
  4100. - fixes for handling of unicode exception values and unprintable objects
  4101. - (issue87) fix unboundlocal error in assertionold code
  4102. - (issue86) improve documentation for looponfailing
  4103. - refine IO capturing: stdin-redirect pseudo-file now has a NOP close() method
  4104. - ship distribute_setup.py version 0.6.10
  4105. - added links to the new capturelog and coverage plugins
  4106. 1.2.0 (2010-01-18)
  4107. ==================
  4108. - refined usage and options for "py.cleanup"::
  4109. py.cleanup # remove "*.pyc" and "*$py.class" (jython) files
  4110. py.cleanup -e .swp -e .cache # also remove files with these extensions
  4111. py.cleanup -s # remove "build" and "dist" directory next to setup.py files
  4112. py.cleanup -d # also remove empty directories
  4113. py.cleanup -a # synonym for "-s -d -e 'pip-log.txt'"
  4114. py.cleanup -n # dry run, only show what would be removed
  4115. - add a new option "py.test --funcargs" which shows available funcargs
  4116. and their help strings (docstrings on their respective factory function)
  4117. for a given test path
  4118. - display a short and concise traceback if a funcarg lookup fails
  4119. - early-load "conftest.py" files in non-dot first-level sub directories.
  4120. allows to conveniently keep and access test-related options in a ``test``
  4121. subdir and still add command line options.
  4122. - fix issue67: new super-short traceback-printing option: "--tb=line" will print a single line for each failing (python) test indicating its filename, lineno and the failure value
  4123. - fix issue78: always call python-level teardown functions even if the
  4124. according setup failed. This includes refinements for calling setup_module/class functions
  4125. which will now only be called once instead of the previous behaviour where they'd be called
  4126. multiple times if they raise an exception (including a Skipped exception). Any exception
  4127. will be re-corded and associated with all tests in the according module/class scope.
  4128. - fix issue63: assume <40 columns to be a bogus terminal width, default to 80
  4129. - fix pdb debugging to be in the correct frame on raises-related errors
  4130. - update apipkg.py to fix an issue where recursive imports might
  4131. unnecessarily break importing
  4132. - fix plugin links
  4133. 1.1.1 (2009-11-24)
  4134. ==================
  4135. - moved dist/looponfailing from py.test core into a new
  4136. separately released pytest-xdist plugin.
  4137. - new junitxml plugin: --junitxml=path will generate a junit style xml file
  4138. which is processable e.g. by the Hudson CI system.
  4139. - new option: --genscript=path will generate a standalone py.test script
  4140. which will not need any libraries installed. thanks to Ralf Schmitt.
  4141. - new option: --ignore will prevent specified path from collection.
  4142. Can be specified multiple times.
  4143. - new option: --confcutdir=dir will make py.test only consider conftest
  4144. files that are relative to the specified dir.
  4145. - new funcarg: "pytestconfig" is the pytest config object for access
  4146. to command line args and can now be easily used in a test.
  4147. - install ``py.test`` and ``py.which`` with a ``-$VERSION`` suffix to
  4148. disambiguate between Python3, python2.X, Jython and PyPy installed versions.
  4149. - new "pytestconfig" funcarg allows access to test config object
  4150. - new "pytest_report_header" hook can return additional lines
  4151. to be displayed at the header of a test run.
  4152. - (experimental) allow "py.test path::name1::name2::..." for pointing
  4153. to a test within a test collection directly. This might eventually
  4154. evolve as a full substitute to "-k" specifications.
  4155. - streamlined plugin loading: order is now as documented in
  4156. customize.html: setuptools, ENV, commandline, conftest.
  4157. also setuptools entry point names are turned to canonical namees ("pytest_*")
  4158. - automatically skip tests that need 'capfd' but have no os.dup
  4159. - allow pytest_generate_tests to be defined in classes as well
  4160. - deprecate usage of 'disabled' attribute in favour of pytestmark
  4161. - deprecate definition of Directory, Module, Class and Function nodes
  4162. in conftest.py files. Use pytest collect hooks instead.
  4163. - collection/item node specific runtest/collect hooks are only called exactly
  4164. on matching conftest.py files, i.e. ones which are exactly below
  4165. the filesystem path of an item
  4166. - change: the first pytest_collect_directory hook to return something
  4167. will now prevent further hooks to be called.
  4168. - change: figleaf plugin now requires --figleaf to run. Also
  4169. change its long command line options to be a bit shorter (see py.test -h).
  4170. - change: pytest doctest plugin is now enabled by default and has a
  4171. new option --doctest-glob to set a pattern for file matches.
  4172. - change: remove internal py._* helper vars, only keep py._pydir
  4173. - robustify capturing to survive if custom pytest_runtest_setup
  4174. code failed and prevented the capturing setup code from running.
  4175. - make py.test.* helpers provided by default plugins visible early -
  4176. works transparently both for pydoc and for interactive sessions
  4177. which will regularly see e.g. py.test.mark and py.test.importorskip.
  4178. - simplify internal plugin manager machinery
  4179. - simplify internal collection tree by introducing a RootCollector node
  4180. - fix assert reinterpreation that sees a call containing "keyword=..."
  4181. - fix issue66: invoke pytest_sessionstart and pytest_sessionfinish
  4182. hooks on slaves during dist-testing, report module/session teardown
  4183. hooks correctly.
  4184. - fix issue65: properly handle dist-testing if no
  4185. execnet/py lib installed remotely.
  4186. - skip some install-tests if no execnet is available
  4187. - fix docs, fix internal bin/ script generation
  4188. 1.1.0 (2009-11-05)
  4189. ==================
  4190. - introduce automatic plugin registration via 'pytest11'
  4191. entrypoints via setuptools' pkg_resources.iter_entry_points
  4192. - fix py.test dist-testing to work with execnet >= 1.0.0b4
  4193. - re-introduce py.test.cmdline.main() for better backward compatibility
  4194. - svn paths: fix a bug with path.check(versioned=True) for svn paths,
  4195. allow '%' in svn paths, make svnwc.update() default to interactive mode
  4196. like in 1.0.x and add svnwc.update(interactive=False) to inhibit interaction.
  4197. - refine distributed tarball to contain test and no pyc files
  4198. - try harder to have deprecation warnings for py.compat.* accesses
  4199. report a correct location
  4200. 1.0.3
  4201. =====
  4202. * adjust and improve docs
  4203. * remove py.rest tool and internal namespace - it was
  4204. never really advertised and can still be used with
  4205. the old release if needed. If there is interest
  4206. it could be revived into its own tool i guess.
  4207. * fix issue48 and issue59: raise an Error if the module
  4208. from an imported test file does not seem to come from
  4209. the filepath - avoids "same-name" confusion that has
  4210. been reported repeatedly
  4211. * merged Ronny's nose-compatibility hacks: now
  4212. nose-style setup_module() and setup() functions are
  4213. supported
  4214. * introduce generalized py.test.mark function marking
  4215. * reshuffle / refine command line grouping
  4216. * deprecate parser.addgroup in favour of getgroup which creates option group
  4217. * add --report command line option that allows to control showing of skipped/xfailed sections
  4218. * generalized skipping: a new way to mark python functions with skipif or xfail
  4219. at function, class and modules level based on platform or sys-module attributes.
  4220. * extend py.test.mark decorator to allow for positional args
  4221. * introduce and test "py.cleanup -d" to remove empty directories
  4222. * fix issue #59 - robustify unittest test collection
  4223. * make bpython/help interaction work by adding an __all__ attribute
  4224. to ApiModule, cleanup initpkg
  4225. * use MIT license for pylib, add some contributors
  4226. * remove py.execnet code and substitute all usages with 'execnet' proper
  4227. * fix issue50 - cached_setup now caches more to expectations
  4228. for test functions with multiple arguments.
  4229. * merge Jarko's fixes, issue #45 and #46
  4230. * add the ability to specify a path for py.lookup to search in
  4231. * fix a funcarg cached_setup bug probably only occurring
  4232. in distributed testing and "module" scope with teardown.
  4233. * many fixes and changes for making the code base python3 compatible,
  4234. many thanks to Benjamin Peterson for helping with this.
  4235. * consolidate builtins implementation to be compatible with >=2.3,
  4236. add helpers to ease keeping 2 and 3k compatible code
  4237. * deprecate py.compat.doctest|subprocess|textwrap|optparse
  4238. * deprecate py.magic.autopath, remove py/magic directory
  4239. * move pytest assertion handling to py/code and a pytest_assertion
  4240. plugin, add "--no-assert" option, deprecate py.magic namespaces
  4241. in favour of (less) py.code ones.
  4242. * consolidate and cleanup py/code classes and files
  4243. * cleanup py/misc, move tests to bin-for-dist
  4244. * introduce delattr/delitem/delenv methods to py.test's monkeypatch funcarg
  4245. * consolidate py.log implementation, remove old approach.
  4246. * introduce py.io.TextIO and py.io.BytesIO for distinguishing between
  4247. text/unicode and byte-streams (uses underlying standard lib io.*
  4248. if available)
  4249. * make py.unittest_convert helper script available which converts "unittest.py"
  4250. style files into the simpler assert/direct-test-classes py.test/nosetests
  4251. style. The script was written by Laura Creighton.
  4252. * simplified internal localpath implementation
  4253. 1.0.2 (2009-08-27)
  4254. ==================
  4255. * fixing packaging issues, triggered by fedora redhat packaging,
  4256. also added doc, examples and contrib dirs to the tarball.
  4257. * added a documentation link to the new django plugin.
  4258. 1.0.1 (2009-08-19)
  4259. ==================
  4260. * added a 'pytest_nose' plugin which handles nose.SkipTest,
  4261. nose-style function/method/generator setup/teardown and
  4262. tries to report functions correctly.
  4263. * capturing of unicode writes or encoded strings to sys.stdout/err
  4264. work better, also terminalwriting was adapted and somewhat
  4265. unified between windows and linux.
  4266. * improved documentation layout and content a lot
  4267. * added a "--help-config" option to show conftest.py / ENV-var names for
  4268. all longopt cmdline options, and some special conftest.py variables.
  4269. renamed 'conf_capture' conftest setting to 'option_capture' accordingly.
  4270. * fix issue #27: better reporting on non-collectable items given on commandline
  4271. (e.g. pyc files)
  4272. * fix issue #33: added --version flag (thanks Benjamin Peterson)
  4273. * fix issue #32: adding support for "incomplete" paths to wcpath.status()
  4274. * "Test" prefixed classes are *not* collected by default anymore if they
  4275. have an __init__ method
  4276. * monkeypatch setenv() now accepts a "prepend" parameter
  4277. * improved reporting of collection error tracebacks
  4278. * simplified multicall mechanism and plugin architecture,
  4279. renamed some internal methods and argnames
  4280. 1.0.0 (2009-08-04)
  4281. ==================
  4282. * more terse reporting try to show filesystem path relatively to current dir
  4283. * improve xfail output a bit
  4284. 1.0.0b9 (2009-07-31)
  4285. ====================
  4286. * cleanly handle and report final teardown of test setup
  4287. * fix svn-1.6 compat issue with py.path.svnwc().versioned()
  4288. (thanks Wouter Vanden Hove)
  4289. * setup/teardown or collection problems now show as ERRORs
  4290. or with big "E"'s in the progress lines. they are reported
  4291. and counted separately.
  4292. * dist-testing: properly handle test items that get locally
  4293. collected but cannot be collected on the remote side - often
  4294. due to platform/dependency reasons
  4295. * simplified py.test.mark API - see keyword plugin documentation
  4296. * integrate better with logging: capturing now by default captures
  4297. test functions and their immediate setup/teardown in a single stream
  4298. * capsys and capfd funcargs now have a readouterr() and a close() method
  4299. (underlyingly py.io.StdCapture/FD objects are used which grew a
  4300. readouterr() method as well to return snapshots of captured out/err)
  4301. * make assert-reinterpretation work better with comparisons not
  4302. returning bools (reported with numpy from thanks maciej fijalkowski)
  4303. * reworked per-test output capturing into the pytest_iocapture.py plugin
  4304. and thus removed capturing code from config object
  4305. * item.repr_failure(excinfo) instead of item.repr_failure(excinfo, outerr)
  4306. 1.0.0b8 (2009-07-22)
  4307. ====================
  4308. * pytest_unittest-plugin is now enabled by default
  4309. * introduced pytest_keyboardinterrupt hook and
  4310. refined pytest_sessionfinish hooked, added tests.
  4311. * workaround a buggy logging module interaction ("closing already closed
  4312. files"). Thanks to Sridhar Ratnakumar for triggering.
  4313. * if plugins use "py.test.importorskip" for importing
  4314. a dependency only a warning will be issued instead
  4315. of exiting the testing process.
  4316. * many improvements to docs:
  4317. - refined funcargs doc , use the term "factory" instead of "provider"
  4318. - added a new talk/tutorial doc page
  4319. - better download page
  4320. - better plugin docstrings
  4321. - added new plugins page and automatic doc generation script
  4322. * fixed teardown problem related to partially failing funcarg setups
  4323. (thanks MrTopf for reporting), "pytest_runtest_teardown" is now
  4324. always invoked even if the "pytest_runtest_setup" failed.
  4325. * tweaked doctest output for docstrings in py modules,
  4326. thanks Radomir.
  4327. 1.0.0b7
  4328. =======
  4329. * renamed py.test.xfail back to py.test.mark.xfail to avoid
  4330. two ways to decorate for xfail
  4331. * re-added py.test.mark decorator for setting keywords on functions
  4332. (it was actually documented so removing it was not nice)
  4333. * remove scope-argument from request.addfinalizer() because
  4334. request.cached_setup has the scope arg. TOOWTDI.
  4335. * perform setup finalization before reporting failures
  4336. * apply modified patches from Andreas Kloeckner to allow
  4337. test functions to have no func_code (#22) and to make
  4338. "-k" and function keywords work (#20)
  4339. * apply patch from Daniel Peolzleithner (issue #23)
  4340. * resolve issue #18, multiprocessing.Manager() and
  4341. redirection clash
  4342. * make __name__ == "__channelexec__" for remote_exec code
  4343. 1.0.0b3 (2009-06-19)
  4344. ====================
  4345. * plugin classes are removed: one now defines
  4346. hooks directly in conftest.py or global pytest_*.py
  4347. files.
  4348. * added new pytest_namespace(config) hook that allows
  4349. to inject helpers directly to the py.test.* namespace.
  4350. * documented and refined many hooks
  4351. * added new style of generative tests via
  4352. pytest_generate_tests hook that integrates
  4353. well with function arguments.
  4354. 1.0.0b1
  4355. =======
  4356. * introduced new "funcarg" setup method,
  4357. see doc/test/funcarg.txt
  4358. * introduced plugin architecture and many
  4359. new py.test plugins, see
  4360. doc/test/plugins.txt
  4361. * teardown_method is now guaranteed to get
  4362. called after a test method has run.
  4363. * new method: py.test.importorskip(mod,minversion)
  4364. will either import or call py.test.skip()
  4365. * completely revised internal py.test architecture
  4366. * new py.process.ForkedFunc object allowing to
  4367. fork execution of a function to a sub process
  4368. and getting a result back.
  4369. XXX lots of things missing here XXX
  4370. 0.9.2
  4371. =====
  4372. * refined installation and metadata, created new setup.py,
  4373. now based on setuptools/ez_setup (thanks to Ralf Schmitt
  4374. for his support).
  4375. * improved the way of making py.* scripts available in
  4376. windows environments, they are now added to the
  4377. Scripts directory as ".cmd" files.
  4378. * py.path.svnwc.status() now is more complete and
  4379. uses xml output from the 'svn' command if available
  4380. (Guido Wesdorp)
  4381. * fix for py.path.svn* to work with svn 1.5
  4382. (Chris Lamb)
  4383. * fix path.relto(otherpath) method on windows to
  4384. use normcase for checking if a path is relative.
  4385. * py.test's traceback is better parseable from editors
  4386. (follows the filenames:LINENO: MSG convention)
  4387. (thanks to Osmo Salomaa)
  4388. * fix to javascript-generation, "py.test --runbrowser"
  4389. should work more reliably now
  4390. * removed previously accidentally added
  4391. py.test.broken and py.test.notimplemented helpers.
  4392. * there now is a py.__version__ attribute
  4393. 0.9.1
  4394. =====
  4395. This is a fairly complete list of v0.9.1, which can
  4396. serve as a reference for developers.
  4397. * allowing + signs in py.path.svn urls [39106]
  4398. * fixed support for Failed exceptions without excinfo in py.test [39340]
  4399. * added support for killing processes for Windows (as well as platforms that
  4400. support os.kill) in py.misc.killproc [39655]
  4401. * added setup/teardown for generative tests to py.test [40702]
  4402. * added detection of FAILED TO LOAD MODULE to py.test [40703, 40738, 40739]
  4403. * fixed problem with calling .remove() on wcpaths of non-versioned files in
  4404. py.path [44248]
  4405. * fixed some import and inheritance issues in py.test [41480, 44648, 44655]
  4406. * fail to run greenlet tests when pypy is available, but without stackless
  4407. [45294]
  4408. * small fixes in rsession tests [45295]
  4409. * fixed issue with 2.5 type representations in py.test [45483, 45484]
  4410. * made that internal reporting issues displaying is done atomically in py.test
  4411. [45518]
  4412. * made that non-existing files are ignored by the py.lookup script [45519]
  4413. * improved exception name creation in py.test [45535]
  4414. * made that less threads are used in execnet [merge in 45539]
  4415. * removed lock required for atomic reporting issue displaying in py.test
  4416. [45545]
  4417. * removed globals from execnet [45541, 45547]
  4418. * refactored cleanup mechanics, made that setDaemon is set to 1 to make atexit
  4419. get called in 2.5 (py.execnet) [45548]
  4420. * fixed bug in joining threads in py.execnet's servemain [45549]
  4421. * refactored py.test.rsession tests to not rely on exact output format anymore
  4422. [45646]
  4423. * using repr() on test outcome [45647]
  4424. * added 'Reason' classes for py.test.skip() [45648, 45649]
  4425. * killed some unnecessary sanity check in py.test.collect [45655]
  4426. * avoid using os.tmpfile() in py.io.fdcapture because on Windows it's only
  4427. usable by Administrators [45901]
  4428. * added support for locking and non-recursive commits to py.path.svnwc [45994]
  4429. * locking files in py.execnet to prevent CPython from segfaulting [46010]
  4430. * added export() method to py.path.svnurl
  4431. * fixed -d -x in py.test [47277]
  4432. * fixed argument concatenation problem in py.path.svnwc [49423]
  4433. * restore py.test behaviour that it exits with code 1 when there are failures
  4434. [49974]
  4435. * don't fail on html files that don't have an accompanying .txt file [50606]
  4436. * fixed 'utestconvert.py < input' [50645]
  4437. * small fix for code indentation in py.code.source [50755]
  4438. * fix _docgen.py documentation building [51285]
  4439. * improved checks for source representation of code blocks in py.test [51292]
  4440. * added support for passing authentication to py.path.svn* objects [52000,
  4441. 52001]
  4442. * removed sorted() call for py.apigen tests in favour of [].sort() to support
  4443. Python 2.3 [52481]