y1 = 0; y2 = 1;
n = 50;
y = Range[y1,y2, (y2-y1)/(n-1.)];
f[x, y] := y Sin[x]
If your function is Listable you can do this
points = {y, NIntegrate[f[x, y], {x, 0, Pi}]} // Transpose;
ListLinePlot[points]
If your function is not Listable:
points = Map[{#, NIntegrate[f[x, #], {x, 0, Pi}]} &, y]
ListLinePlot[points]
enter image description here